2022-10-27 15:07:13 +00:00
|
|
|
export function fibonacci(value) {
|
|
|
|
// implementar logica aqui
|
2022-10-28 18:58:51 +00:00
|
|
|
const arr = [0, 1];
|
|
|
|
for (let i = 2; i <= value; i++) {
|
|
|
|
arr[i] = arr[i - 2] + arr[i - 1];
|
|
|
|
}
|
|
|
|
return arr[value];
|
2022-10-27 15:07:13 +00:00
|
|
|
}
|