Skip to content

Commit 1e7904e

Browse files
Time: 54 ms (52.52%), Space: 68.8 MB (81.12%) - LeetHub
1 parent 27b04aa commit 1e7904e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class Solution {
2+
public int findMinArrowShots(int[][] points) {
3+
4+
int maxAct = 1;
5+
6+
Arrays.sort(points,(a,b)->Integer.compare(a[1],b[1]));
7+
int last = points[0][1];
8+
for(int i = 1 ; i<points.length;i++){
9+
if(last<points[i][0]){
10+
maxAct++;
11+
last = points[i][1];
12+
}
13+
}
14+
return maxAct;
15+
}
16+
}

0 commit comments

Comments
 (0)