Description
Solutions
Subarray Removal

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
Thumbnail 0
Testcase

Result
Case 1

input:

output: