[LeetCode]Climbing Stairs(Java)

<span style="font-size:24px;">public class Solution {
public int climbStairs(int n) {
if(n == 1)
return 1;
else if(n == 2)
return 2;
else{
int i = 3,first = 2,next = 3,m=0;
while(i!=n){
i++;
m=next;
next = next+first;
first = m;
}
return next;
}
}
}</span>

2016/8/30

• 本文已收录于以下专栏：

【LeetCode-面试算法经典-Java实现】【073-Climbing Stairs（爬楼梯）】

【070-Climbing Stairs（爬楼梯）】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题　　You are climbing a stair case. It ta...

leetcode解题之70 #Climbing Stairs Java版 （青蛙跳台阶）

leetcode解题之70 #Climbing Stairs Java版 （青蛙跳台阶）

leetcode Climbing Stairs

You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb...

Leetcode 70. Climbing Stairs

You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1...

LeetCode 70 Climbing Stairs（爬楼梯）（动态规划）（*）

• NoMasp
• 2016-01-14 07:12
• 3857

[LeetCode]70.Climbing Stairs

【题目】 You are climbing a stair case. It takes n steps to reach to the top. Each time you can eithe...

[LeetCode]70. Climbing Stairs(求爬楼梯有几种方式)

70. Climbing Stairs原题链接 You are climbing a stair case. It takes n steps to reach to the top.Each ti...

举报原因： 您举报文章：深度学习：神经网络中的前向传播和反向传播算法推导 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)