class Solution { public: int jumpFloorII(int number) { int jumpFlo=1; while(--number) { jumpFlo*=2; } return jumpFlo; } };
public class Solution { public int JumpFloorII(int target) { if (target<=0){ return -1; }else if (target==1){ return 1; }else { return 2*JumpFloorII(target-1); } } }
# -*- coding:utf-8 -*- class Solution: def jumpFloorII(self, number): # write code here