š Sliding Window
The "Moving Magnifying Glass" Chapter
Like looking through a moving magnifying glass! A window slides across the array, growing and shrinking as needed. Perfect for "subarray" problems!
Easy
ā
Best Time to Buy/Sell Stock
Max profit with one transaction!
Medium
ā
Longest Substring Without Repeating
Longest unique character substring!
Medium
ā
Minimum Window Substring
Smallest window containing all chars!
šÆ Brain Hack
Expand, then shrink! Add elements to right, update window info. When condition violated, shrink from left. O(n) instead of O(n²)!