public class Solution { public int climbStairs(int n) { int[] level = new int[n+1]; level[0] = 0; level[1] = 1; if(n >=2 ) level[2] =2; for(int i = 3; i< level.length ; i++){ level[i] = level[i-1] + level[i-2]; } return level[n]; } }
相关文章
- 12-02leetcode 113 路径总和II
- 12-02leetcode 113. 路径总和 II
- 12-02【LeetCode】451-根据字符出现频率排序
- 12-02LeetCode 451. 根据字符出现频率排序
- 12-02【每日一题】Leetcode - 面试题 01.06. Compress String LCCI(字符串压缩)
- 12-02743. Network Delay Time[Medium](Leetcode每日一题-2021.08.02)
- 12-02LeetCode 面试题 01.06. Compress String LCCI
- 12-02Leetcode周赛164
- 12-02力扣LeetCode 204. 计数质数
- 12-02每天一道Rust-LeetCode(2019-06-01)