Given an array of integers, write a function to find the indices m and n such that the elements in the index range [m, n] are the only part that needs to be sorted for the entire array to become ordered, with n-m as small as possible; return [m, n] or [-1, -1] if the array is already ordered.
Use zero-based indices and nondecreasing order. The function must return the shortest valid inclusive range.
Input: One integer array nums.
Output: A two-element list [m, n], or [-1, -1] when nums is already sorted.
def shortest_unsorted_subarray(nums):