Problem: Given an integer array nums, find the smallest subarray that needs to be sorted (ascending) in order for the whole array to be sorted. Return the length of the subarray. Example:
Input: nums = [2,6,4,8,10,9,15]
Output: 5
Explanation: You need to sort [6, 4, 8, 10, 9] in ascending order to make…