Available question text
Find the length of the shortest contiguous subarray which, if sorted, makes the entire array non-decreasing — i.e., identify the minimal window that violates the global sorted order. This can be recognized with linear-time patterns (scanning min/max from both ends or using monotonic stacks).
Related questions
Continue with questions that share topics or the same question type.
- Continuous Subarray Sum
Coding
- Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
Coding · Array · Heap (Priority Queue) · Monotonic Queue
- Shortest Subarray to be Removed to Make Array Sorted
Coding
- Shortest Subarray With OR at Least K I
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Amazon
Leetcode 581. Shortest Unsorted Continuous Subarray
Reported Aug 4, 2026 · 1 source report
SENIOR
Source snapshot: Nov 12, 2026
View source