Search
⌘K

Leetcode 665. Non-decreasing Array

Determine whether an integer array can be made non-decreasing by modifying at most one element. The core challenge is a greedy single-pass: detect inversions (nums[i] > nums[i+1]) and ensure there is at most one and that the offending pair can be fixed by changing either element without causing another violation.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.