468. Check if Array Can Be Made Strictly Increasing by Removing One Element

EasyBinary SearchArrayGreedy

Given an integer array nums, return true if you can remove at most one element to make it strictly increasing. A strictly increasing array has nums[i] < nums[i+1] for all valid i.

Input: An integer array nums.

Output: true if removable, false otherwise.

Examples

Example 1
Input: [1,2,10,3,4]
Output: true
Explanation: Remove 10 → [1,2,3,4] is strictly increasing.
Example 2
Input: [1,2,3,4,5]
Output: true
Explanation: Already strictly increasing — no removal needed.
Example 3
Input: [5,4,3,2,1]
Output: false
Explanation: Even after removing one element, the rest is not strictly increasing.

Constraints

Asked by

TCSInfosysWiproCognizantCapgemini
Solve this problem in the editor →