struct Solution{ } impl Solution { fn new() -> Self { Solution{} } /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param number int整型 * @return int整型 */ pub fn jumpFloorII(&self, number: i32) -> i32 { let (mut prefix, mut ans) = (0 as i32, 0 as i32); for i in 0..number { ans = prefix + 1; prefix += ans; } return ans; } }