class Solution { public: int dp[50]{0}; // initialize an array to store the number of ways to jump to each floor int jumpFloor(int number) { dp[1] = 1; // there is only one way to jump to the first floor dp[2] = 2; // there are two ways to jump to the second floor for(int i=3; i<=number;i++){ dp[i] = dp[i-1] + dp[i-2]; // the number of ways to jump to the i-th floor is the sum of the number of ways to jump to the (i-1)th floor and the (i-2)th floor } return dp[number]; // return the number of ways to jump to the n-th floor } };