Problem · Array
Subarray Removal
Learn this problemProblem statement
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.
Function
subarrayRemoval(arr: int[]) → intExamples
Example 1
arr = [1, 2, 1, 2]return = 7
Constraints
O_O