Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 03696c4

Browse files
committed
2019-12-04
1 parent b3f1573 commit 03696c4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)