LeetCode 581: Shortest Unsorted Continuous Subarray
Problem Restatement We are given an integer array nums . We need to find the shortest continuous subarray such that, if we sort only that subarray in non-decreasing order, the whole array becomes sorted in non-decreasing order. Return the length of that subarray. If the array is already sorted, return 0 . The constraints are 1 <= nums.length <= 10^4 and -10^5 <= nums[i] <= 10^5 . The follow-up asks...