题目绕了一堆意思是相交的气球可以一次被射爆
也就是求不相交区间的最长长度
def findMinArrowShots(self, points):
"""
:type points: List[List[int]]
:rtype: int
"""
#题目绕了一堆意思是相交的气球可以一次被射爆
#也就是求不相交区间的长度
points.sort(key = lambda x : x[1])
n = len(points)
end = points[0][1]
count = 1
for i in range(1,n):
if points[i][0] > end:
count += 1
end = points[i][1]
return count