criando o codigo do e o calculo fibonacci que deve retornar #1

Merged
PatrickSouzaSilva merged 1 commits from feature/fibonacci into develop 2022-11-02 16:19:49 +00:00

View File

@ -1,4 +1,9 @@
export function fibonacci(value) {
export function fibonacci(value, memo) {
// implementar logica aqui
}
memo = memo || {}
if (memo[value]) return memo[value]
if (value <= 1) return value
return (memo[value] = fibonacci(value - 1, memo) + fibonacci(value - 2, memo))
}