Skip to content

Commit 72cf03a

Browse files
iamAntimPalAntim-IWPIamShiwangi
committed
Update 452. Minimum Number of Arrows to Burst Balloons.py
Co-Authored-By: Antim-IWP <203163676+Antim-IWP@users.noreply.github.com> Co-Authored-By: Shiwangi Srivastava <174641070+IamShiwangi@users.noreply.github.com>
1 parent a91b761 commit 72cf03a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution:
2+
def findMinArrowShots(self, points: List[List[int]]) -> int:
3+
ans, last = 0, -inf
4+
for a, b in sorted(points, key=lambda x: x[1]):
5+
if a > last:
6+
ans += 1
7+
last = b
8+
return ans

0 commit comments

Comments
 (0)