Tap here to switch tabs
Problem
Submissions

Problem: Minimum Prefix Removal for a Strictly Increasing Array

med
30 min
Try to solve the Minimum Prefix Removal for a Strictly Increasing Array problem.

Statement

You are given an integer array nums.

You must remove a prefix from nums such that the remaining array is strictly increasing.

Return the minimum length of the prefix that needs to be removed.

Note: An array is considered strictly increasing if every element is strictly greater than the element immediately preceding it. An array with 00 or 11 element is also strictly increasing.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • −109≤-10^9 \leq nums[i] ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Prefix Removal for a Strictly Increasing Array

med
30 min
Try to solve the Minimum Prefix Removal for a Strictly Increasing Array problem.

Statement

You are given an integer array nums.

You must remove a prefix from nums such that the remaining array is strictly increasing.

Return the minimum length of the prefix that needs to be removed.

Note: An array is considered strictly increasing if every element is strictly greater than the element immediately preceding it. An array with 00 or 11 element is also strictly increasing.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • −109≤-10^9 \leq nums[i] ≤109\leq 10^9