1. Two Sum | optimize if else (in or not in?), subtraction | |
14. Longest Common Prefix | | |
169. Majority Element | count and balance the appearance to at least 0, change to new number once they're back | |
217. Contains Duplicate | sorting, check i-1 vs i or using set | 1 |
242. Valid Anagram | hasmap with get, how to check character in s has the same frequency to t (different order) | |
303. Range Sum Query - Immutable | prefix | |
383. Ransom Note | | |
409. Longest Palindrome | | |
448. Find All Numbers Disappeared in an Array | negate value for existing number, positive value is the missing one | |
705. Design HashSet | | |
706. Design HashMap | | |
1929. Concatenation of Array | | |