Given an integer array arr of length n that contains a permutation of the values from arr into the maximum number of contiguous chunks.
After splitting, sort each chunk individually and then concatenate the sorted chunks in their original order. Return the largest possible number of chunks such that the final concatenated array is fully sorted in nondecreasing order.
Constraints:
n == arr.length
n
arr[i] n
All elements of arr are unique.
Given an integer array arr of length n that contains a permutation of the values from arr into the maximum number of contiguous chunks.
After splitting, sort each chunk individually and then concatenate the sorted chunks in their original order. Return the largest possible number of chunks such that the final concatenated array is fully sorted in nondecreasing order.
Constraints:
n == arr.length
n
arr[i] n
All elements of arr are unique.