We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b3f1573 commit 03696c4Copy full SHA for 03696c4
1 file changed
0452.用最少数量的箭引爆气球/0452-用最少数量的箭引爆气球.py
@@ -0,0 +1,20 @@
1
+class Solution(object):
2
+ def findMinArrowShots(self, points):
3
+ """
4
+ :type points: List[List[int]]
5
+ :rtype: int
6
7
+ if not points or not points[0]:
8
+ return 0
9
+
10
+ points.sort(key = lambda x:x[1])
11
12
+ arrow = points[0][1]
13
14
+ res = 1
15
+ for point in points:
16
+ if arrow < point[0]:
17
+ res += 1
18
+ arrow = point[1]
19
20
+ return res
0 commit comments