665. Non-decreasing Array
Last updated
Last updated
Given an array with n
integers, your task is to check if it could become non-decreasing by modifying at most 1
element.
We define an array is non-decreasing if array[i] <= array[i + 1]
holds for every i
(1 <= i < n).
Example 1:
Example 2:
Note: The n
belongs to [1, 10,000].