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