变态跳台阶优解
变态跳台阶
http://www.nowcoder.com/questionTerminal/22243d016f6b47f2a6928b4313c85387
用两个变量存储结果
public class Solution {
public int JumpFloorII(int target) {
int a = 0;
int sum = 1;
for(int i = 1; i <= target; i++){
sum = sum + a;
a = sum;
}
return a;
}
}