Skip to content

Commit 3331c34

Browse files
authored
Update min-cost-climbing-stairs.md
1 parent 442f233 commit 3331c34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/min-cost-climbing-stairs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Using dynamic programming, we fill an array with the minimum costs from the base
7373
```python
7474
def minCostClimbingStairs(cost):
7575
n = len(cost)
76-
dp = [0] * (n + 1)
76+
dp = [0] * (n + 2)
7777

7878
# Start calculating the minimum cost from the top to the base.
7979
for i in range(n - 1, -1, -1):

0 commit comments

Comments
 (0)