Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 02a097a

Browse files
added daily challenge
1 parent f55979b commit 02a097a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Solution:
2+
def findMinArrowShots(self, points: List[List[int]]) -> int:
3+
points.sort(key=lambda x: x[1])
4+
5+
arrows = 1
6+
prevEnd = points[0][1]
7+
8+
for i in range(1, len(points)):
9+
if points[i][0] > prevEnd:
10+
arrows += 1
11+
prevEnd = points[i][1]
12+
13+
return arrows

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /