Merge pull request 'feat(fibonacci): adiciona resolucao questao04-fibonacci' (#4) from feature/fibonacci into development

Reviewed-on: #4
This commit is contained in:
Carlos Eduardo T. Winter 2022-10-28 18:59:48 +00:00
commit 8518be3bbb

View File

@ -1,4 +1,8 @@
export function fibonacci(value) { export function fibonacci(value) {
// implementar logica aqui // implementar logica aqui
const arr = [0, 1];
for (let i = 2; i <= value; i++) {
arr[i] = arr[i - 2] + arr[i - 1];
}
return arr[value];
} }