diff --git a/04-fibonacci/index.js b/04-fibonacci/index.js index 37c64cc..eae7c30 100644 --- a/04-fibonacci/index.js +++ b/04-fibonacci/index.js @@ -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; } \ No newline at end of file