Search
⌘K

Leetcode 3555. Smallest Subarray to Sort in Every Sliding Window

For each fixed-size sliding window in an array, determine the length of the smallest contiguous subarray that must be sorted so the whole window becomes sorted. The challenge is to compute these minimal unsorted-segment bounds efficiently for every window (better than sorting each window), typically by using local minima/maxima or monotonic data structures.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.

Leetcode 3555. Smallest Subarray to Sort in Every Sliding Window | Hello Interview