Coding problems · by pattern

14 array problems, solved step by step.

Problems where the input is a plain array and the work is in how you walk it: one pass with a running value, two indices moving toward each other, or a helper structure built on the way. Each one is solved in 22 languages from brute force to optimal, with code you can run on the page.

0/14 solved
  1. Two SumEasy
  2. Contains DuplicateEasy
  3. Best Time to Buy and Sell StockEasy
  4. Majority ElementEasy
  5. Missing NumberEasy
  6. Maximum SubarrayMedium
  7. Product of Array Except SelfMedium
  8. 3SumMedium
  9. Container With Most WaterMedium
  10. Merge IntervalsMedium
  11. Search in Rotated Sorted ArrayMedium
  12. Kth Largest Element in an ArrayMedium
  13. Jump GameMedium
  14. Trapping Rain WaterHard