题解 | #跳台阶#
跳台阶扩展问题
http://www.nowcoder.com/practice/22243d016f6b47f2a6928b4313c85387
class Solution
{
public int jumpFloorII(int number)
{
// write code here
if(number<=1){
return 1;
}
int sum = 0;
for(int i=1; i<=number; i++){
sum+=jumpFloorII(number-i);
}
return sum;
}
}
{
public int jumpFloorII(int number)
{
// write code here
if(number<=1){
return 1;
}
int sum = 0;
for(int i=1; i<=number; i++){
sum+=jumpFloorII(number-i);
}
return sum;
}
}