File tree Expand file tree Collapse file tree 1 file changed +0
-21
lines changed
src/main/java/com/fishercoder/solutions Expand file tree Collapse file tree 1 file changed +0
-21
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
2
3
- /**
4
- * 665. Non-decreasing Array
5
- *
6
- * Given an array with n integers, your task is to check if it could become non-decreasing by modifying at most 1 element.
7
-
8
- We define an array is non-decreasing if array[i] <= array[i + 1] holds for every i (1 <= i < n).
9
-
10
- Example 1:
11
-
12
- Input: [4,2,3]
13
- Output: True
14
- Explanation: You could modify the first 4 to 1 to get a non-decreasing array.
15
-
16
- Example 2:
17
-
18
- Input: [4,2,1]
19
- Output: False
20
- Explanation: You can't get a non-decreasing array by modify at most one element.
21
-
22
- Note: The n belongs to [1, 10,000].
23
- */
24
3
public class _665 {
25
4
26
5
public static class Solution1 {
You can’t perform that action at this time.
0 commit comments