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 c7e4d2d commit e101f27Copy full SHA for e101f27
climbing-stairs/paragon0107_230.java
@@ -0,0 +1,11 @@
1
+class Solution {
2
+ public int climbStairs(int n) {
3
+ int[] dp = new int[n + 1];
4
+ dp[1] = 1;
5
+ dp[2] = 2;
6
+ for(int i=3;i<=n;i++){
7
+ dp[i] = dp[i - 2] + dp[i - 1];
8
+ }
9
+ return dp[n];
10
11
+}
0 commit comments