题解 | #二叉树中和为某一值的路径(一)#
跳台阶扩展问题
http://www.nowcoder.com/practice/22243d016f6b47f2a6928b4313c85387
public class Solution {
public int jumpFloorII(int target) {
if (target==0||target==1){
return 1;
}
int[] dp=new int[target+1];
dp[0]=dp[1]=1;
for (int i = 2; i <=target ; i++) {
for (int j = 0; j < i; j++) {
dp[i]+=dp[j];
}
}
return dp[target];
}
}
注意 每次跳的数量是 1到n 得重新累加之前的数据
剑指offer69题是一次才能跳1或者2个台阶 ,

