Sliding Window
Problems using the sliding window technique
33 lessons
84 min
Lessons
1. What is Sliding Window
Pattern overview
2m
2. Prerequisites
What you need first
1m
3. When to Use
Pattern triggers
2m
4. When NOT to Use
Avoid forcing this pattern
2m
5. Fixed vs Variable Window
Two window types
2m
6. LeetCode 121 Best Time to Buy and Sell Stock - Problem Statement
The problem
2m1 problems
7. LeetCode 121 Best Time to Buy and Sell Stock - Solution
The core idea
3m
8. LeetCode 121 Best Time to Buy and Sell Stock - Example and Complexity Analysis
Walkthrough and analysis
3m
9. LeetCode 121 Best Time to Buy and Sell Stock - Implementation
The approach
4m1 problems
10. LeetCode 3 Longest Substring Without Repeating Characters - Problem Statement
The problem
2m1 problems
11. Quiz: Choosing the Right Data Structure
Test your understanding
2m1 problems
12. LeetCode 3 Longest Substring Without Repeating Characters - Why Naive Fails
The trap
2m
13. LeetCode 3 Longest Substring Without Repeating Characters - Solution
The core idea
3m
14. LeetCode 3 Longest Substring Without Repeating Characters - Example and Complexity Analysis
Walkthrough and analysis
3m
15. LeetCode 3 Longest Substring Without Repeating Characters - Implementation
The approach
4m1 problems
16. LeetCode 424 Longest Repeating Character Replacement - Problem Statement
The problem
2m1 problems
17. Quiz: Calculating Replacements Needed
Test your understanding
2m1 problems
18. LeetCode 424 Longest Repeating Character Replacement - Why Naive Fails
The trap
2m
19. LeetCode 424 Longest Repeating Character Replacement - Solution
The core idea
3m
20. LeetCode 424 Longest Repeating Character Replacement - Example and Complexity Analysis
Walkthrough and analysis
3m
21. LeetCode 424 Longest Repeating Character Replacement - Implementation
The approach
4m1 problems
22. LeetCode 76 Minimum Window Substring - Problem Statement
The problem
2m1 problems
23. LeetCode 76 Minimum Window Substring - Why Naive Fails
The trap
2m
24. LeetCode 76 Minimum Window Substring - Solution
The core idea
3m
25. LeetCode 76 Minimum Window Substring - Example and Complexity Analysis
Walkthrough and analysis
3m
26. LeetCode 76 Minimum Window Substring - Implementation
The approach
4m1 problems
27. LeetCode 239 Sliding Window Maximum - Problem Statement
The problem
2m1 problems
28. LeetCode 239 Sliding Window Maximum - Why Naive Fails
The trap
2m
29. LeetCode 239 Sliding Window Maximum - Solution
The core idea
3m
30. LeetCode 239 Sliding Window Maximum - Example and Complexity Analysis
Walkthrough and analysis
3m
31. LeetCode 239 Sliding Window Maximum - Implementation
The approach
4m1 problems
32. Common Mistakes
Common errors to avoid
2m
33. Section Recap
Summary
1m
Practice Problems
1.
2.
3.
4.
5.