forked from M3-Academy/challenge-algorithms-v2.0
feature/algoritmos #1
@ -1,4 +1,11 @@
|
||||
export function fibonacci(value) {
|
||||
// implementar logica aqui
|
||||
let a = 0, b = 1, c = value;
|
||||
|
||||
for (let i = 2; i <= value; i++) {
|
||||
c = a + b;
|
||||
a = b;
|
||||
b = c;
|
||||
}
|
||||
return c;
|
||||
}
|
Loading…
Reference in New Issue
Block a user