f(n)=f(n-1)+f(n-2)+...+f(1)
f(n-1)=f(n-2)+...f(1)
得:f(n)=2*f(n-1)
public class Solution { public int JumpFloorII(int target) { return 1<<(target-1); //return (int)Math.pow(2,target-1); } }
f(n)=f(n-1)+f(n-2)+...+f(1)
f(n-1)=f(n-2)+...f(1)
得:f(n)=2*f(n-1)
public class Solution { public int JumpFloorII(int target) { return 1<<(target-1); //return (int)Math.pow(2,target-1); } }