Tap here to switch tabs
Problem
Submissions

Problem: Count the Number of Incremovable Subarrays I

Count the Number of Incremovable Subarrays I asks you to count nonempty contiguous subarrays whose removal leaves the rest of the positive-integer array strictly increasing, including an empty remainder.

Statement

You are given a 00 indexed array of positive integers nums.

A subarray of nums is called incremovable if the remaining elements of nums are strictly increasing after removing the subarray.

Return the total count of incremovable subarrays in nums.

Note: An empty remaining array is considered strictly increasing. The removed subarray must be non empty.

Constraints:

  • 1≤1 \leq nums.length ≤50\leq 50

  • 1≤1 \leq nums[i] ≤50\leq 50

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count the Number of Incremovable Subarrays I

Count the Number of Incremovable Subarrays I asks you to count nonempty contiguous subarrays whose removal leaves the rest of the positive-integer array strictly increasing, including an empty remainder.

Statement

You are given a 00 indexed array of positive integers nums.

A subarray of nums is called incremovable if the remaining elements of nums are strictly increasing after removing the subarray.

Return the total count of incremovable subarrays in nums.

Note: An empty remaining array is considered strictly increasing. The removed subarray must be non empty.

Constraints:

  • 1≤1 \leq nums.length ≤50\leq 50

  • 1≤1 \leq nums[i] ≤50\leq 50