Array
3903. Smallest Stable Index I
The score at index i mixes two directions at once — the largest value in the prefix nums[0..i] and the smallest in the suffix nums[i..n-1] — so the whole problem collapses once I precompute those two running extremes instead of rescanning both windows for every index.
Loading…