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

Commit08d5d21

Browse files
authored
Update Last Moment Before All Ants Fall Out of a Plank.java
1 parentc69da4f commit08d5d21

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
classSolution {
2-
publicintgetLastMoment(intn,int[]left,int[]right) {
3-
intres =0;
4-
for (intant :left) {
5-
res =Math.max(res,ant);
2+
publicintgetLastMoment(intn,int[]left,int[]right) {
3+
intresult =0;
4+
for (intnum :left) {
5+
result =Math.max(result,num);
6+
}
7+
for (intnum :right) {
8+
result =Math.max(result,n -num);
9+
}
10+
returnresult;
611
}
7-
for (intant :right) {
8-
res =Math.max(res,n -ant);
9-
}
10-
returnres;
11-
}
1212
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp