An odometer should produce non-decreasing readings, but at most one reading may be corrupted. Return True if readings can be made non-decreasing by changing at most one element (to any value), and False otherwise.
Examples
Input: readings = [9, 5, 7, 8]
Output: True
Explanation: Change the 9 to 5 (or to anything smaller).
Input: readings = [8, 6, 2, 9]
Output: False
Input: readings = [5, 8, 4, 6]
Output: False
Constraints
0 <= len(readings) <= 10**5-10**9 <= readings[i] <= 10**9- Target: O(n) time; do not try every possible change.
Goals
- Allow exactly one violation while validating an ordering
- Decide which of two neighbours to adjust by looking one element further back