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

Commit5a2175e

Browse files
refactor 624
1 parent7b10217 commit5a2175e

File tree

1 file changed

+6
-6
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+6
-6
lines changed

‎src/main/java/com/fishercoder/solutions/_624.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
publicclass_624 {
88

99
publicstaticclassSolution1 {
10-
publicintmaxDistance(int[][]arrays) {
10+
publicintmaxDistance(List<List<Integer>>arrays) {
1111
List<Integer>max =newArrayList<>();
12-
for (int[]array :arrays) {
13-
max.add(array[array.length -1]);
12+
for (List<Integer>array :arrays) {
13+
max.add(array.get(array.size() -1));
1414
}
1515
Collections.sort(max);
1616
intans =Integer.MIN_VALUE;
17-
for (int[]array :arrays) {
18-
intbig =array[array.length -1] ==max.get(max.size() -1) ?max.get(max.size() -2) :max.get(max.size() -1);
19-
ans =Math.max(ans,big -array[0]);
17+
for (List<Integer>array :arrays) {
18+
intbig =array.get(array.size() -1) ==max.get(max.size() -1) ?max.get(max.size() -2) :max.get(max.size() -1);
19+
ans =Math.max(ans,big -array.get(0));
2020
}
2121
returnans;
2222
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp