摘要:
用Trie, dp会TLE 阅读全文
摘要:
1 class Solution { 2 public List findAnagrams(String s, String p) { 3 List res = new ArrayList(); 4 if(s.length() == 0 || s.length() 0 ) count--; 15 end++; 16... 阅读全文
摘要:
用Dequeue 阅读全文
摘要:
https://leetcode.com/problems/minimum-window-substring/discuss/26808/Here-is-a-10-line-template-that-can-solve-most-'substring'-problems 阅读全文
摘要:
1 class Solution { 2 public boolean validPalindrome(String s) { 3 if(s.length() == 0) return true; 4 int i = 0, j = s.length() - 1; 5 while(i < j){ 6 if(... 阅读全文
摘要:
记录前面的sum https://leetcode.com/problems/subarray-sum-equals-k/discuss/102106/Java-Solution-PreSum-+-HashMap 阅读全文