feature #1

Merged
wellingtonCarlos merged 11 commits from feature into master 2022-11-02 18:10:07 +00:00
Showing only changes of commit c31eca56ff - Show all commits

View File

@ -1,4 +1,17 @@
export function fibonacci(value) {
// implementar logica aqui
if (value < 1) return 0
if (value <= 2) return 1
let fibonnaci1 = 0
let fibonnaci2 = 1
let fibx = value
for (let i = 2; i <= value; i++) {
fibx = fibonnaci2 + fibonnaci1
fibonnaci1 = fibonnaci2
fibonnaci2 = fibx
}
return fibx
}