class Solution:
def findMinArrowShots(self, points):
# 按每个气球的 end 排序
p = sorted(points, key=lambda x: x[1])
res = 0
arrow = p[0][0] - 1
# 比较每个气球的 start 和 arrow
for each in p:
# 需要多一支箭,有效范围到 end
if each[0] > arrow:
res += 1
arrow = each[1]
return res