摘要:
It's like the packing problem. Brute force: 阅读全文
摘要:
We can avoid more duplicate work by check [0, haystack - needle + 1] length. Need to revisit KMP 阅读全文
摘要:
Follow up questions, what if dup allows: 1. Map<Value, Queue<Indexes>> if it looks like a queue first in first out. 2. Map<Value, Map<Index, Indexes>> 阅读全文
摘要:
class Solution { public int longestConsecutive(int[] nums) { if (nums.length set = new HashSet(); for (int num : nums) { set.add(num); } i... 阅读全文