Tap here to switch tabs
Problem
Submissions

Problem: Non-decreasing Array

Non-decreasing Array asks whether an integer array can be made non-decreasing by changing at most one element, including arrays with negative values.

Statement

Given an integer array nums of length n, determine whether it can become non decreasing by modifying at most 11 element.

An array nums is non decreasing if nums[i] ≤\leq nums[i + 1] holds for every index i such that 0≤0 \leq i ≤\leq n −2- 2.

Constraints:

  • n ==== nums.length

  • 1≤1 \leq n ≤104\leq 10^4

  • −105≤-10^5 \leq nums[i] ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Non-decreasing Array

Non-decreasing Array asks whether an integer array can be made non-decreasing by changing at most one element, including arrays with negative values.

Statement

Given an integer array nums of length n, determine whether it can become non decreasing by modifying at most 11 element.

An array nums is non decreasing if nums[i] ≤\leq nums[i + 1] holds for every index i such that 0≤0 \leq i ≤\leq n −2- 2.

Constraints:

  • n ==== nums.length

  • 1≤1 \leq n ≤104\leq 10^4

  • −105≤-10^5 \leq nums[i] ≤105\leq 10^5