// TOPIC
#sliding-window
2 articles
◆BeginnerAmazonGoogle
01Deques (Double-Ended Queues)
A deque gives you O(1) push and pop from both ends — and the sliding-window-maximum trick that turns O(n²) brute-force problems into clean O(n) solutions.
#deques#queues#stacks
11 min◆◆IntermediateAmazonGoogle
02The Sliding Window Pattern
Learn the sliding window technique to solve "longest/shortest/contains" subarray and substring problems in O(n) instead of O(n²). Covers fixed and variable windows, the expand-right-shrink-left template, and the classic bugs.
#sliding-window#two-pointers#arrays
10 min