c++

```class Solution {
public:
int jumpFloorII(int number) {
if (number ==0 || number==1) return 1;
vector<int> f(number+1, 0);
f[0]=1;
f[1]=1;
for (int i =2; i<=number; i++){
for (int j=0; j<i; j++){
f[i]=f[i]+f[j];
}
}
return f[number];
}
};```

```class Solution {
public:
int jumpFloorII(int number) {
if(number == 0 || number == 1) return 1;
int ans=1;
for(int i=2; i<=number; i++){
ans = ans << 1;
}
return ans;
}
};```

```class Solution {
public:
int jumpFloorII(int number) {
if(number == 0 || number == 1) return 1;
return pow(2,number-1);
}
};```

```class Solution {
public:
int jumpFloorII(int number) {
if (number ==0 || number ==1) return 1;
int ans = 0;
while(number>=0){
number--;
ans = ans + jumpFloorII(number);
}
return ans;

}
};```

```class Solution {
public:
int Fib(int n, vector<int> &dp){
if (n==0 ||n==1) return 1;
if (dp[n] != 0) return dp[n];
int temp =n;
while(temp>=0){
temp--;
dp[n]= dp[n] + Fib(temp, dp);
}
return dp[n];
}
int jumpFloorII(int number) {
vector<int> dp(number+1, 0);
return Fib(number, dp);
}
};```

```class Solution {
public:
int jumpFloorII(int number) {
if(number == 0 || number == 1) return 1;
return jumpFloorII(number-1)*2;
}
};```

2022-12-20 17:21

2022-12-12 11:15

2022-12-29 13:09
Durham University_2022

2022-12-21 19:56

2022-12-11 21:41

2022-12-09 17:24

2022-12-07 18:00

2022-12-06 22:26

2022-12-04 22:42

2022-12-13 20:05

2022-12-13 18:23

01-13 18:31

2022-12-06 13:45

01-11 20:08

2022-12-09 18:39