author: Blankj blog : http://blankj.com time : 2017/05/09 desc :
| 9 | * </pre> |
| 10 | */ |
| 11 | public 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected