摘要:
public int KMPSearch(String s, String subStr) { int[] next = generateNext(subStr); int i = 0; // full string index int j = 0; // sub string index int 阅读全文
摘要:
暴力解法,O(n²) public int lengthOfLongestSubstring(String s) { ArrayList<Integer> lenList = new ArrayList<>(); for (int i = 0; i < s.length(); i++) { Set< 阅读全文