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 c7fb61e commit fb0dfb7Copy full SHA for fb0dfb7
src/com/blankj/myself/SkipLadder.java
@@ -0,0 +1,28 @@
1
+package com.blankj.myself;
2
+
3
+/**
4
+ * Description:
5
+ * Copyright: Copyright (c) 2012
6
+ * Company: keruyun Technology(Beijing) Chengdu Co. Ltd.
7
+ *
8
+ * @author huangjk
9
+ * @version 1.0 2020/5/20
10
+ */
11
+public class SkipLadder {
12
+ public static void main(String[] args) {
13
14
+ }
15
16
+ public int climbStairs(int n) {
17
+ if(n==1){
18
+ return 1;
19
20
+ int[] nums = new int[n];
21
+ nums[0] = 1;
22
+ nums[1] = 2;
23
+ for (int i=2;i<n;i++){
24
+ nums[i] = nums[i-2] + nums[i-1];
25
26
+ return nums[n-1];
27
28
+}
0 commit comments