摘要: public int KMPSearch(String s, String subStr) { int[] next = generateNext(subStr); int i = 0; // full string index int j = 0; // sub string index int 阅读全文
posted @ 2023-02-14 17:39 jrjewljs 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 暴力解法,O(n²) public int lengthOfLongestSubstring(String s) { ArrayList<Integer> lenList = new ArrayList<>(); for (int i = 0; i < s.length(); i++) { Set< 阅读全文
posted @ 2023-02-14 16:02 jrjewljs 阅读(17) 评论(0) 推荐(0) 编辑