diff --git a/#70/Solution.java b/#70/Solution.java new file mode 100644 index 0000000..867aa4b --- /dev/null +++ b/#70/Solution.java @@ -0,0 +1,16 @@ +/** + * https://leetcode.com/problems/climbing-stairs/ + */ + +class Solution { + public int climbStairs(int n) { + return fib(n + 1); + } + + public int fib(int n) + { + if (n <= 1) + return n; + return fib(n-1) + fib(n-2); + } +}