Showing Posts From

Substrings

Two Pointers & Sliding Window (Advanced)

Two Pointers & Sliding Window (Advanced)

Week 19 notes: Phase 2 kicks off by pushing the two most reused array patterns to medium/hard. Variable windows with a shrink rule, the at-most/exactly counting trick, and multi-pointer partitioning.

Sliding Window Algorithm - Fixed & Variable Length

Sliding Window Algorithm - Fixed & Variable Length

Week 0 notes on the sliding window: when to use it, fixed vs variable windows, and how it turns a lot of subarray and substring problems from O(n^2) into O(n).