Skip to content

Commit 5bc452d

Browse files
authored
Merge pull request #12 from iamAntimPal/Leetcode-75
Leetcode 75
2 parents e3f5528 + 0240e70 commit 5bc452d

File tree

2 files changed

+465
-0
lines changed

2 files changed

+465
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Solution:
2+
def minCostClimbingStairs(self, cost: List[int]) -> int:
3+
@cache
4+
def dfs(i: int) -> int:
5+
if i >= len(cost):
6+
return 0
7+
return cost[i] + min(dfs(i + 1), dfs(i + 2))
8+
9+
return min(dfs(0), dfs(1))

0 commit comments

Comments
 (0)