DEV Community

Naveen Karasu
Naveen Karasu

Posted on

Day 17/365: Sliding Window -- Variable -- DSA & System Design

Day 17/365: Sliding Window -- Variable -- DSA & System Design

365 Day DSA & System Design Challenge

Day 17 was about making adaptive windows feel logical.

What I wanted clear today:

  • variable windows move because of a condition, not a preset width
  • longest-substring problems shrink to repair invalidity
  • minimum-window problems shrink after the target is satisfied
  • the state inside the window is as important as the pointers
  • pointer moves get easier once the exact condition is named

The biggest shift was realizing that variable-window problems are really negotiations with a rule. If I can say what makes the window invalid or sufficient, then I can explain why the left edge moves and why the right edge keeps expanding.

That also gave me a cleaner review habit: write down the exact condition first, then the pointer moves usually stop looking random.

That made Day 17 feel much more manageable than the old template version of this topic.


Day 17/365 of the 365 Day DSA & System Design Challenge.

Top comments (0)