Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4d7e3a4

Browse files
add 1909
1 parent6366297 commit4d7e3a4

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ _If you like this project, please leave me a star._ ★
99
| # | Title | Solutions | Video | Difficulty | Tag
1010
|-----|----------------|---------------|--------|-------------|-------------
1111
|1910|[Remove All Occurrences of a Substring](https://leetcode.com/problems/remove-all-occurrences-of-a-substring/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1904.java)||Medium|String|
12+
|1909|[Remove One Element to Make the Array Strictly Increasing](https://leetcode.com/problems/remove-one-element-to-make-the-array-strictly-increasing/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1909.java)||Easy|Array|
1213
|1904|[The Number of Full Rounds You Have Played](https://leetcode.com/problems/the-number-of-full-rounds-you-have-played/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1904.java)||Medium|String, Greedy|
1314
|1903|[Largest Odd Number in String](https://leetcode.com/problems/largest-odd-number-in-string/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1903.java)||Easy|Greedy|
1415
|1897|[Redistribute Characters to Make All Strings Equal](https://leetcode.com/problems/redistribute-characters-to-make-all-strings-equal/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1897.java)||Easy|String, Greedy|
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
packagecom.fishercoder.solutions;
2+
3+
publicclass_1909 {
4+
publicstaticclassSolution1 {
5+
/**
6+
* credit: https://leetcode.com/problems/remove-one-element-to-make-the-array-strictly-increasing/discuss/1298827/Java-Short
7+
*/
8+
publicbooleancanBeIncreasing(int[]nums) {
9+
booleanremoved =false;
10+
for (inti =1;i <nums.length;i++) {
11+
if (nums[i] <=nums[i -1]) {
12+
if (removed) {
13+
returnfalse;
14+
}else {
15+
removed =true;
16+
}
17+
if (i >1 &&nums[i] <=nums[i -2]) {
18+
nums[i] =nums[i -1];
19+
}
20+
}
21+
}
22+
returntrue;
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp