Skip to content

Commit 21b4ce2

Browse files
committed
Add Solution.py for 0887.Super Egg Drop
1 parent 19b5614 commit 21b4ce2

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
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 superEggDrop(self, K: int, N: int) -> int:
3+
dp = [1] * (K)
4+
while dp[K - 1] < N:
5+
for i in range(K - 1, 0, -1):
6+
dp[i] = dp[i] + dp[i - 1] + 1
7+
dp[0] = dp[0] + 1
8+
return dp[0]

solution/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,8 @@
943943
│   └── Solution.py
944944
├── 0887.Super Egg Drop
945945
│   ├── README.md
946-
│   └── Solution.java
946+
│   ├── Solution.java
947+
│   └── Solution.py
947948
├── 0889.Construct Binary Tree from Preorder and Postorder Traversal
948949
│   ├── README.md
949950
│   └── Solution.py

0 commit comments

Comments
 (0)