【leetcode】使用最小花费爬楼梯

int minCostClimbingStairs(int* cost, int costSize){
    int i,f1=0,f2=0;
    for (i=costSize-1; i>=0; i--)
    {
        int f0 = cost[i] + fmin(f1,f2);
        f2 = f1;
        f1 = f0;
    }    
    return fmin(f1,f2);
}
原文地址:https://www.cnblogs.com/ganxiang/p/13692874.html