3555. Smallest Subarray to Sort in Every Sliding Window
ArrayTwo PointersStackGreedySortingMonotonic Stack
Hints
Hint 1
Solve for each subarray independently.
Hint 2
What are the extreme positions that need to be included in the segment to make the subarray non‑decreasing?
Preparing judge…