Daily challenge for 2026-11-19
688. Longest Stable Pipeline Throughput
An industrial facility monitors throughput rates at successive checkpoints along an automated pipeline, given as an array of positive integers throughput. The operations team defines a window of contiguous checkpoints as stable if the difference between the maximum and minimum throughput values within that window does not exceed max_gap.
Return the length of the longest contiguous subsegment of checkpoints that maintains a stable throughput rate.
Example:Input: {"throughput": [4, 8, 5, 6, 9, 2], "max_gap": 3}Output: 3
Constraints:
- 1 <= throughput.length <= 10^5
- 1 <= throughput[i] <= 10^9
- 0 <= max_gap <= 10^9
Run this challenge interactively in Python or JavaScript when the app loads.