Description
Solutions
Subarray Removal
📚RELATED PROBLEMS
Given an array arr
of n
integers, find the number of its subarrays such that removing the subarray creates a non-empty array that is sorted in increasing order.
Note: A subarray is defined as any contiguous segment of the array.
Example 1:
Input: arr = [1, 2, 1, 2]
Output: 7
Explanation:![]()
Constraints:
O_O

Related Problems
Testcase
Result
Case 1
input:
output: