MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / search

Function search

javascript/0070-climbing-stairs.js:76–83  ·  view source on GitHub ↗
(n, tabu)

Source from the content-addressed store, hash-verified

74};
75
76var search = (n, tabu) => {
77 for (let index = 3; index <= n; index++) {
78 /* Time O(N) */
79 const [prev, prevPrev] = [index - 1, index - 2];
80
81 tabu[index] = tabu[prev] + tabu[prevPrev]; /* Space O(N) */
82 }
83};
84
85/**
86 * DP - Fibonacci Number

Callers 1

climbStairsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected