File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/main/java/com/fishercoder/solutions Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 77public class _624 {
88
99 public static class Solution1 {
10- public int maxDistance (int [][] arrays ) {
10+ public int maxDistance (List < List < Integer >> arrays ) {
1111 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 ) );
1414 }
1515 Collections .sort (max );
1616 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 ) );
2020 }
2121 return ans ;
2222 }
You can’t perform that action at this time.
0 commit comments