DP where dp[i] is min cost to reach the top starting from step i.
Compute from the end:
dp[i] = cost[i] + min(dp[i+1], dp[i+2]).
Answer is min(dp[0], dp[1]).
DP where dp[i] is min cost to reach the top starting from step i.
Compute from the end:
dp[i] = cost[i] + min(dp[i+1], dp[i+2]).
Answer is min(dp[0], dp[1]).