NeetCode #816LC-1574MediumGreedy
← Back to All Problems#816 · #1574 · Shortest Subarray to be Removed to Make Array Sorted(删除最短的子数组使剩余数组有序)
📌 Problem Statement & Constraints
Given an integer array
arr, you may remove one contiguous subarray so that the remaining elements are non-decreasing. Return the minimum length of such a subarray. Constraints: 1 <= arr.length <= 10^5, 0 <= arr[i] <= 10^9.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!