Best Time to Buy and Sell Stock as a Window Problem
Max profit in one pass by tracking the running minimum buy price. Python solution and complexity analysis for the sliding window interview pattern.
The Augmented Dev ยท Archive
Dynamics 365, Power Platform, AI, system design, and web development โ filter by theme or search across every post.
Newsletter
One email per post. No spam, no tracking pixels, unsubscribe anytime.
11 of 325 articles tagged sliding-window
Max profit in one pass by tracking the running minimum buy price. Python solution and complexity analysis for the sliding window interview pattern.
Every anagram start index in one pass โ the counting version of inclusion. Python solution and complexity analysis for the sliding window interview pattern.
Google's storytelling version of longest subarray with two distinct values. Python solution and complexity analysis for the sliding window interview pattern.
Replace k chars to maximize a repeat run โ with a window that never shrinks. Python solution and complexity analysis for the sliding window interview pattern.
The most-asked string question: variable window with a last-seen map. Python solution and complexity analysis for the sliding window interview pattern.
Longest run of ones after flipping at most k zeros โ count, never flip. Python solution and complexity analysis for the sliding window interview pattern.
The fixed-window template: slide a length-k sum in O(1) per step. Python solution and complexity analysis for the sliding window interview pattern.
Shortest window reaching a target sum โ shrink while you still can. Python solution and complexity analysis for the sliding window interview pattern.
Smallest window covering all of t, with the have-versus-need counter. Python solution and complexity analysis for the sliding window interview pattern.
Detect an anagram window in O(n) with an incremental match counter. Python solution and complexity analysis for the sliding window interview pattern.
Window max in O(n) โ the monotonic deque, explained properly. Python solution and complexity analysis for the sliding window interview pattern.