Coding problems · by pattern

5 two pointers problems, solved step by step.

Problems solved by two indices that move toward each other or side by side, each step ruling out a whole range of candidates, so a quadratic search becomes linear. Each one is solved in 22 languages from brute force to optimal, with code you can run on the page.

0/5 solved
  1. Valid PalindromeEasy
  2. Merge Two Sorted ListsEasy
  3. 3SumMedium
  4. Container With Most WaterMedium
  5. Trapping Rain WaterHard