Cheapest climb up the stairs
A staircase has steps 0 to n - 1, and landing on step i costs cost[i]. You start on the floor just below step 0 and want to reach the top, just above the last step; the floor and the top are free. Each move climbs one or two positions. Return the minimum total cost to reach the top.
cost may be empty and its values are non-negative. Aim for O(1) extra space.
Besides the tests, one large input (31 steps) with a ~200 ms limit (scaled to your device's speed): brute force won't pass.
Examples
min_climb_cost([3,9,4])→7min_climb_cost([1,2,100,1])→3min_climb_cost([2,50,2,2,50,2,50,2])→10