-
k Sum
2 Sum--exactly one solution/no duplicates- HashMap:O(n) <=no duplicate
- Sort+Two Pointers:O(nlogn); if sorted:O(n)
3 Sum-contains duplicates
- Sort+Two Pointers:O(n^2)
- Sort+Two Pointers:O(n^2), cannot use hashmap since it looks for the closest answer instead of the exact one.
- Sort+Two Pointers:O(n^3),some modifications to avoid useless computations
- 'Two Sum' solution:O(n^2*logn)
-
Rotation -to be continued
Rotate Array -
Contains Duplicate -not finnished yet
Contains Duplicate I
Contains Duplicate II -
Intersection of Two Arrays -to be continued
Intersection of Two Arrays I
- Best Time to Buy and Sell Stock -to be continued
Best Time to Buy and Sell Stock
Best Time to Buy and Sell Stock II
Best Time to Buy and Sell Stock with Cooldown - Majority Element
- Dynamic Programming - 2D -to be continued
Minimum Path Sum
- Find Peak Element -to be continued