MCPcopy Create free account
hub / github.com/Blankj/awesome-java-leetcode / Solution

Class Solution

src/com/blankj/easy/_0070/Solution.java:11–25  ·  view source on GitHub ↗

author: Blankj blog : http://blankj.com time : 2017/05/09 desc :

Source from the content-addressed store, hash-verified

9 * </pre>
10 */
11public class Solution {
12 public int climbStairs(int n) {
13 int a = 1, b = 1;
14 while (--n > 0) {
15 b += a;
16 a = b - a;
17 }
18 return b;
19 }
20
21 public static void main(String[] args) {
22 Solution solution = new Solution();
23 System.out.println(solution.climbStairs(3));
24 }
25}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected