每一级都可能从前n-1级直接跳上来的 那么每一级可能的情况其实就是前n-1项的和
0 1 2 3 4 5 1 1 2 4 8 16
public int jumpFloorII(int target) { if (target==0){ return 0; } return new Double(Math.pow(2, target - 1)).intValue(); }
本文分享自 作者个人站点/博客 前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文参与 腾讯云自媒体同步曝光计划 ,欢迎热爱写作的你一起参与!