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 33b1096 commit 50ea04cCopy full SHA for 50ea04c
climbing-stairs/doitduri.swift
@@ -0,0 +1,11 @@
1
+class Solution {
2
+ func climbStairs(_ n: Int) -> Int {
3
+ var tables = [0, 1, 2]
4
+ for i in 3...45 {
5
+ let result = tables[i-1] + tables[i-2]
6
+ tables.append(result)
7
+ }
8
+
9
+ return tables[n]
10
11
+}
0 commit comments