Question: Hi how do i do this in Python? Exercise 2 - Min-cost climbing stairs On a staircase, the i-th step has some non-negative cost cost

 Hi how do i do this in Python? Exercise 2 -

Hi how do i do this in Python?

Exercise 2 - Min-cost climbing stairs On a staircase, the i-th step has some non-negative cost cost [ i ] assigned to it. The staircase starts at index i=0. Once you pay the cost, you can either climb one or two steps. Design and implement an algorithm to find the minimum cost to reach the top floor. You can start your climb from either step index 0 , or step index 1. For example, given a staircase of 9 floors (from 0 to 8 ) and input cost =[1,100,1,1,1,100,1,1,100,1], the min-cost climb starting from 0 is 6. Hint Think from top to bottom, and bottom to top

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!