Leetcode 2653. Sliding Subarray Beauty
For each size-k sliding window, return the x-th smallest negative number (or 0 if the window has fewer than x negatives), requiring a sliding-window order-statistics over negative values. Because nums values lie in a small fixed range (−50..50), this can be done efficiently by maintaining counts/frequencies as the window moves.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.