Shortest Subarray to be Removed to Make Array Sorted
Given an integer arrayarr, remove a subarray (can be empty) fromarrsuch that the remaining elements inarrarenon-decreasing.
Returnthe length of the shortest subarray to remove.
Asubarrayis a contiguous subsequence of the array.
Example 1:
Inp...
原创
2022-04-06 11:51:31 ·
276 阅读 ·
0 评论