452. Minimum Number of Arrows to Burst Balloons
class Solution:
def findMinArrowShots(self, points: List[List[int]]) -> int:
points.sort(key=lambda x: (x[1], x[0]))
end = points[0][1]
count = 1
for i in range(1, len(points)):
if end < points[i][0]:
# 等於的情況依然算是重疊
end = points[i][1]
count += 1
return countLast updated