
题目描述
一只青蛙一次可以跳上1级台阶,也可以跳上2级……它也可以跳上n级。求该青蛙跳上一个n级的台阶总共有多少种跳法。
思路
Just write down the result array and we find that the Array is 1,2,4,8…
It is a simple array(every time by 2).
代码
1 |
public int JumpFloorII(int target) { |

一只青蛙一次可以跳上1级台阶,也可以跳上2级……它也可以跳上n级。求该青蛙跳上一个n级的台阶总共有多少种跳法。
Just write down the result array and we find that the Array is 1,2,4,8…
It is a simple array(every time by 2).
1 |
public int JumpFloorII(int target) { |
近期评论