forked from M3-Academy/challenge-algorithms-v2.0
Merge pull request 'feat: solucao fibonacci' (#4) from feature/solucao-fibonacci into development
Reviewed-on: #4
This commit is contained in:
commit
80d10d4ba8
@ -1,4 +1,8 @@
|
||||
export function fibonacci(value) {
|
||||
// implementar logica aqui
|
||||
|
||||
let arr = [0, 1];
|
||||
for (let i = 2; i < value + 1; i++) {
|
||||
arr.push(arr[i - 2] + arr[i - 1]);
|
||||
}
|
||||
return arr[value];
|
||||
}
|
Loading…
Reference in New Issue
Block a user