Skip to content

Commit

Permalink
2019-12-04
Browse files Browse the repository at this point in the history
  • Loading branch information
JiayangWu committed Dec 5, 2019
1 parent b3f1573 commit 03696c4
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class Solution(object):
def findMinArrowShots(self, points):
"""
:type points: List[List[int]]
:rtype: int
"""
if not points or not points[0]:
return 0

points.sort(key = lambda x:x[1])

arrow = points[0][1]

res = 1
for point in points:
if arrow < point[0]:
res += 1
arrow = point[1]

return res

0 comments on commit 03696c4

Please sign in to comment.