feat: resolve fibonacci
This commit is contained in:
parent
31a926baf2
commit
10b8f2fd45
@ -1,4 +1,15 @@
|
||||
export function fibonacci(value) {
|
||||
// implementar logica aqui
|
||||
let val1 = 0
|
||||
let val2 = 1
|
||||
let valFib
|
||||
|
||||
for (let i = 1; i <= value; i++){
|
||||
valFib = val2 + val1
|
||||
val1 = val2
|
||||
val2 = valFib
|
||||
}
|
||||
|
||||
return val1
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user