Min Cost Climbing Stairs

You are given an integer array cost where cost[i] is the cost of stepping off the i-th stair. Once you pay the cost you can climb one or two steps. You may start from index 0 or index 1. Return the minimum cost to reach the top of the floor, which is one index past the last element.

Examples
Input: [10,15,20]
Output: 15
Hints

Min Cost Climbing Stairs

You are given an integer array cost where cost[i] is the cost of stepping off the i-th stair. Once you pay the cost you can climb one or two steps. You may start from index 0 or index 1. Return the minimum cost to reach the top of the floor, which is one index past the last element.