humbertoferro #1

Merged
Humberto.Ferro merged 9 commits from humbertoferro into master 2022-10-31 21:34:30 +00:00
Showing only changes of commit 31c440491f - Show all commits

View File

@ -1,4 +1,14 @@
export function fibonacci(value) {
// implementar logica aqui
if (value < 1) return 0
if (value <= 2) return 1
let fib1 = 0
let fib2 = 1
let fibN = value
for (let i = 2; i <=value; i++){
fibN = fib2 + fib1
fib1 = fib2
fib2 = fibN
}
return fibN
}