Skip to content

Commit 08c9961

Browse files
committed
Time: 354 ms (5.16%), Space: 79.7 MB (21.94%) - LeetHub
1 parent 9e47cfe commit 08c9961

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
class Solution {
2+
public int maxWidthOfVerticalArea(int[][] points) {
3+
4+
5+
int[] temp = new int[points.length];
6+
for(int i =0; i < points.length;i++){
7+
temp[i] = points[i][0];
8+
}
9+
10+
Arrays.sort(temp);
11+
12+
int max = Integer.MIN_VALUE;
13+
14+
for(int i =temp.length - 1; i >0; i-- ){
15+
int pre = temp[i] - temp[i - 1];
16+
System.out.println(temp[i]);
17+
max = Math.max(max, pre);
18+
}
19+
20+
return max;
21+
}
22+
}
23+

0 commit comments

Comments
 (0)