Skip to main content

two pointers

Easy

NumberNoteTimes
26. Remove Duplicates from Sorted Arraystarting from k=1 and check curr nums[i] with previous nums[k]
27. Remove Elementnums[count] and nums[i]
88. Merge Sorted Arrayadd the biggest from last to first, use 3 pointers, edge case is second arr remains
125. Valid Palindrome
283. Move Zeroes
344. Reverse String
680. Valid Palindrome II
844. Backspace String Compare
977. Squares of a Sorted Array
1768. Merge Strings Alternately

Medium

NumberNoteTimes
11. Container With Most Watertwo pointer, left right, check min height, find max space, increase or decrease when which one is smaller
15. 3Sumsort, fix each + 2 pointer, check two consecutive in fix and check two consecutive in pointer (yes, increase left)
16. 3Sum Closest
18. 4Sum
167. Two Sum II - Input Array Is Sorted
189. Rotate Array
881. Boats to Save People

Hard

NumberNoteTimes
42. Trapping Rain Water

Optional