Skip to content

Commit 6c9051e

Browse files
committed
Runtime: 392 ms (Top 9.30%) | Memory: 14.4 MB (Top 11.38%)
1 parent 12e7f0c commit 6c9051e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Runtime: 392 ms (Top 9.30%) | Memory: 14.4 MB (Top 11.38%)
12
class Solution:
23
def champagneTower(self, poured: int, r: int, c: int) -> float:
34
quantity=defaultdict(int)
@@ -6,15 +7,11 @@ def champagneTower(self, poured: int, r: int, c: int) -> float:
67
flag=False
78
for j in range(i+1):
89
prev_flow=quantity[(i,j)]-1
9-
if prev_flow<=0:
10+
if prev_flow<=0:
1011
continue
1112
flag=True
1213
quantity[(i,j)]=1
1314
quantity[(i+1,j)]+=prev_flow/2
1415
quantity[(i+1,j+1)]+=prev_flow/2
1516
if not flag: break
1617
return quantity[(r,c)]
17-
18-
19-
20-

0 commit comments

Comments
 (0)