We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 808198b commit 4639059Copy full SHA for 4639059
src/ClimbingStairs.java
@@ -0,0 +1,14 @@
1
+public class ClimbingStairs {
2
+ private static final int[] result = new int[50];
3
+
4
+ static {
5
+ result[0] = result[1] = 1;
6
+ for (int index = 2 ; index < result.length ; index++) {
7
+ result[index] = result[index - 1] + result[index - 2];
8
+ }
9
10
11
+ public static int climbStairs(int steps) {
12
+ return result[steps];
13
14
+}
0 commit comments