题解 | #跳台阶#
跳台阶
https://www.nowcoder.com/practice/8c82a5b80378478f9484d87d1c5f12a4
package main /** * * @param number int整型 * @return int整型 */ func jumpFloor(number int) int { dp := make([]int,50,50) dp[0] = 1 dp[1] = 2 for i := 2; i < number; i++ { dp[i] = dp[i-1] + dp[i-2] } return dp[number-1] // write code here }