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 ca238f6 commit 4af9171Copy full SHA for 4af9171
climbing-stairs/changchanghwang.go
@@ -0,0 +1,10 @@
1
+// Time complexity, O(n)
2
+// Space complexity, O(1)
3
+// 피보나치 수열로 풀이가 가능하다.
4
+func climbStairs(n int) int {
5
+ a, b := 1, 1
6
+ for ; n > 1; n-- {
7
+ a, b = b, a+b
8
+ }
9
+ return b
10
+}
0 commit comments