Merge k Sorted Lists: priority queue 3Sum: method 1: use dictionary, like 2sum, need counter (fast dictionary) method 2: use 2 pointers, and sort the lists Container With Most Water: 2 pointers, from large to small Longest Substring Without Repeating Characters: sliding window, 2 pointers Longest Valid Parentheses: method 1: stack method 2: DP. For dp, first need to specify what to update (states);second need to specify the updating rules. method 3: two pointers and two traversal of the string Search for a Range: indexes of binary search Permuations: backtracking. Recursion: propagate path Group Anagrams: 'abc' = ''.join(sorted('bca')). sorted(str) returns a sorted list with letters in str. ''.join(list) return a str with items in list.
haozhouamzn / notes Goto Github PK
View Code? Open in Web Editor NEWThis project forked from howardzhou/notes