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 10217f7 commit fe71144Copy full SHA for fe71144
problems/0509.斐波那契数.md
@@ -220,7 +220,17 @@ func fib(n int) int {
220
return c
221
}
222
```
223
-
+Javascript:
224
+```Javascript
225
+var fib = function(n) {
226
+ let dp = [0, 1]
227
+ for(let i = 2; i <= n; i++) {
228
+ dp[i] = dp[i - 1] + dp[i - 2]
229
+ }
230
+ console.log(dp)
231
+ return dp[n]
232
+};
233
+```
234
235
236
0 commit comments