14 · 8 lessons

Algorithm patterns

Prefix tables, monotonic stacks, binary-search boundaries, dependency order and memory-efficient dynamic programming.

Progress and your code are kept in this browser only.

  1. 1Answer range sums with a prefix table
  2. 2Apply many range updates with differences
  3. 3Resolve pending answers with a monotonic stack
  4. 4Find a boundary instead of an exact match
  5. 5Schedule dependencies with indegrees
  6. 6Reduce edit-distance memory to one row
  7. 7Use descending capacity for 0/1 knapsack
  8. 8Merge sorted streams without sorting again