Problem 2762 · Medium

Continuous Subarrays

Slide a window while two monotonic deques track its maximum and minimum; each right end adds all valid starts at once.

Open the interactive visualisation