feature/algoritmos #1

Merged
LeonardoPereiraRocha merged 10 commits from feature/algoritmos into master 2022-11-02 20:24:57 +00:00
Showing only changes of commit da3c5aab72 - Show all commits

View File

@ -1,4 +1,13 @@
export function fibonacci(value) {
// implementar logica aqui
let previous = 0;
let sum = 0;
let next = 1;
for (let i = 0; i < value; i++) {
sum = previous + next;
previous = next;
next = sum;
}
return previous;
}