- 229. Majority Element II
Moore Voting: delete a pair of different numbers at one time.
Need to validate if they are larger than n/3.
- 18. 4Sum
4Sum and 3Sum is similar. Both of them use 2Sum’s method. Fast and slow pointer from sides to center.
Throw bad case as many as you can to reduce loop time.