Two Sum
Keys:
HashMap
- O(n)
https://leetcode.com/problems/two-sum/
Two Sum II (not allow duplicates) (sorted)
Keys:
- two pointer
- O(nlog(n))
https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/
Three Sum (not allow duplicates) (sorted or not)
Keys:
- two pointer
- outer loop to traverse first occurence
- hashset
- no-sort
- O(n^2)
https://leetcode.com/problems/3sum/
Three Sum Smaller
https://leetcode.com/problems/3sum-smaller/ (To be reviewed)
Three Sum Closest
https://leetcode.com/problems/3sum-closest/ (To be reviewed)