File tree 1 file changed +6
-6
lines changed
src/main/java/com/fishercoder/solutions
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 7
7
public class _624 {
8
8
9
9
public static class Solution1 {
10
- public int maxDistance (int [][] arrays ) {
10
+ public int maxDistance (List < List < Integer >> arrays ) {
11
11
List <Integer > max = new ArrayList <>();
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 ) );
14
14
}
15
15
Collections .sort (max );
16
16
int ans = Integer .MIN_VALUE ;
17
- for (int [] array : arrays ) {
18
- int big = 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
+ int big = 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 ) );
20
20
}
21
21
return ans ;
22
22
}
You can’t perform that action at this time.
0 commit comments