0, 1, …, n - 1, and standing on step i costs fees[i]. The top lies just past the last step and is free.
From the floor you may step straight onto step 0 or step 1. After paying for a step, you move up either one step or two.
Return the smallest total you have to pay to reach the top.fees=[4, 20, 3, 30] → 7
Start on step 0 (pay 4), jump to step 2 (pay 3), then skip one step to the top. Total 7.
fees=[8, 2] → 2
Start right on step 1, pay 2 and step onto the top.
fees=[0, 5, 5, 0, 5] → 5
fees=[4, 20, 3, 30]
7
Run checks the first 3 tests in your browser. Submit checks all 100 tests on the server, hidden ones included.