Skip to content

Commit 98a86f8

Browse files
committed
Runtime: 110 ms (Top 69.47%) | Memory: 14.5 MB (Top 12.98%)
1 parent 79e3f72 commit 98a86f8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
# Runtime: 110 ms (Top 69.47%) | Memory: 14.5 MB (Top 12.98%)
12
class Solution:
23
def new21Game(self, n: int, k: int, maxPts: int) -> float:
34
dp = collections.deque([float(i <= n) for i in range(k, k + maxPts)])
45
s = sum(dp)
56
for i in range(k):
67
dp.appendleft(s / maxPts)
78
s += dp[0] - dp.pop()
8-
9+
910
return dp[0]

0 commit comments

Comments
 (0)