leetcode-剑指10-OK

同主战的70
address

int numWays(int n){
    if(n==0)
        return 1;
    int A[n+1];
    A[0] = 1;
    A[1] = 1;
    for (int i = 2;i<= n;i++)
        A[i] = (A[i-1] + A[i-2])%1000000007;
    return A[n];
}
posted @ 2021-01-21 18:44  RougeBW  阅读(35)  评论(0编辑  收藏  举报