Back to Roadmap
Week 2Day 14 of 35

Week 2 Review

Reinforce Kadane, sliding window, and prefix-sum thinking before week 3.

Day Progress0%

0 of 11 problems solved

Pattern Focus

Week 2 Review

Reinforce Kadane, sliding window, and prefix-sum thinking before week 3.

Pattern Checklist
  • Can I tell Kadane apart from Sliding Window?
  • Do I know when to use a Set vs a frequency map?
  • Do I know when prefix sum beats a window?
🧭New to DSA? Start here 🧠

Week two is where moving-window thinking starts to feel natural. Some problems want the biggest valid window. Some want the smallest valid window. Some want a fixed-size window. And one sneaky problem, Subarray Sum Equals K, is not really a sliding window at all. Review day is about learning to notice those differences early, before you write code that fights the problem instead of helping it.

The pattern choice matters as much as the implementation details.

How to think about it
  1. 1Ask whether the window size is fixed, growing, or shrinking.
  2. 2If the rule depends on duplicates or counts, think Set or frequency map.
  3. 3If the goal is best subarray without a literal window rule, ask whether Kadane fits better.
  4. 4If the problem asks for exact subarray sums with possible negatives, think prefix sum plus HashMap.
🚧Common Mistake

Treating every subarray problem like sliding window is a classic week-two trap. Some of them want prefix sums instead.

Problems

Review: Maximum Subarray

medium

Review: Longest Substring Without Repeating Characters

medium

Review: Minimum Size Subarray Sum

medium

Review: Longest Repeating Character Replacement

medium

Review: Permutation in String

medium

Review: Subarray Sum Equals K

medium

Extra: Maximum Average Subarray I

easy

Extra: Find All Anagrams in a String

medium

Extra: Fruit Into Baskets

medium

Extra: Continuous Subarray Sum

medium

Extra: Sliding Window Maximum

hard