2 ms·
The Leetcode question for sliding window maximum is https://leetcode.com/problems/sliding-window-maximum/ https://leetcode.com/problems/sliding-window-maximum/
by yorwba 2y ago
The Leetcode question for sliding window maximum is https://leetcode.com/problems/sliding-window-maximum/ https://leetcode.com/problems/sliding-window-maximum/ Which can be solved using a specialized implementation for max.
But the article even discusses a generic solution for any monoid.
Either sum or max is easier than sum and max and a bunch of other operations all at the same time.