class Solution(object):
def findMinArrowShots(self, points):
"""
:type points: List[List[int]]
:rtype: int
"""
#sort the coordinates by their end positions
points.sort(key=lambda x:x[1])
end=float('-inf')
res=0
for b in points:
if b[0]>end:
res+=1
end=b[1]
return res
网友评论