6 points · by bytego · 6mo ago · 3 comments
Monotonic Deque — Algorhythm
Maintain a deque of indices with strictly-monotonic values — the front evicts when the window slides past, the back drops what's dominated. The front is always the window's max in O(1).
Algorhythm