Skip to content
BytePatterns

Arrays

Pointers, windows and in-place tricks, drawn out step by step.

Arrays progress0 / 8
  1. Array BasicsOne block of memory, instant access to any slot.4m
  2. Two PointersTwo indexes closing in beat one loop nesting another.5m
  3. Sliding WindowReuse the last answer instead of recomputing it.5m
  4. Prefix SumsPay once up front, answer range queries instantly.5m
  5. In-Place ReversalFlip an array with one temp variable, not a copy.4m
  6. Move ZeroesPush the junk to the back without losing the order.5m
  7. Container With Most WaterThe shorter wall decides. So move the shorter wall.6m
  8. Kadane's AlgorithmDrop the past the moment it starts costing you.6m