🪟 1. Fixed Size Window 🟢 Easy
- Maximum Average Subarray I
- Defuse the Bomb 🟡 Medium
- Permutation in String
- Find All Anagrams in a String
- Grumpy Bookstore Owner
📏 2. Variable Size Window (Longest) 🟢 Easy
- Longest Nice Substring 🟡 Medium
- Longest Substring Without Repeating Characters 🔥
- Longest Repeating Character Replacement 🔥
- Max Consecutive Ones III 🔥
- Fruit Into Baskets
📉 3. Variable Size Window (Shortest) 🟡 Medium
- Minimum Size Subarray Sum 🔴 Hard
- Minimum Window Substring 🔥 (TOP PRIORITY)
- Shortest Subarray with Sum at Least K
🎯 MUST-DO LIST (If You Have Limited Time)
👉 Mastering these will cover 90% of sliding window scenarios:
- Maximum Average Subarray I (Fixed)
- Longest Substring Without Repeating Characters (Variable - Longest)
- Minimum Size Subarray Sum (Variable - Shortest)
- Minimum Window Substring (Advanced Variable)
- Permutation in String (Fixed - Hash Map)
- Max Consecutive Ones III (Variable - Flip logic)
⚡ Smart Practice Strategy
- Identify the Type: Is the window size fixed or does it change based on a condition?
- Expansion: Move the
rightpointer to expand the window and include more elements. - Contraction: Move the
leftpointer to shrink the window once the condition is met (or violated). - State Management: Use a Hash Map, Frequency Array, or a Simple Variable to track the current window's "state" (sum, count, unique chars).
| Pattern Category | Total Questions |
|---|---|
| 🪟 1. Fixed Size Window | 5 |
| 📏 2. Variable Size Window (Longest) | 5 |
| 📉 3. Variable Size Window (Shortest) | 3 |
| Total Questions | 13 |
| 🎯 Must-Do Problems | 6 |