Skip to content

Commit 37fc0c8

Browse files
committed
Runtime: 199 ms (Top 36.11%) | Memory: 13.8 MB (Top 87.22%)
1 parent e80e8a4 commit 37fc0c8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/algorithms/M/Maximum Height by Stacking Cuboids/Maximum Height by Stacking Cuboids.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Runtime: 199 ms (Top 36.11%) | Memory: 13.8 MB (Top 87.22%)
2+
13
class Solution:
24
def maxHeight(self, cuboids: List[List[int]]) -> int:
35
dp=[0]*len(cuboids)
@@ -12,4 +14,4 @@ def maxHeight(self, cuboids: List[List[int]]) -> int:
1214
dp[i]=max(dp[i],dp[j]+cuboids[i][2])
1315
if dp[i]>max_value:
1416
max_value=dp[i]
15-
return max_value
17+
return max_value

0 commit comments

Comments
 (0)