diff --git a/03-maxValue/index.js b/03-maxValue/index.js index e433b31..9000cac 100644 --- a/03-maxValue/index.js +++ b/03-maxValue/index.js @@ -1,4 +1,17 @@ export function maxValue(values) { // implementar logica aqui + let maior = 0; + values.map( + (element, i) => { + if(i === 0) + maior = element; + + if(element > maior) + maior = element; + + } + ); + + return maior; } \ No newline at end of file diff --git a/04-fibonacci/index.js b/04-fibonacci/index.js index 37c64cc..ebd1ee5 100644 --- a/04-fibonacci/index.js +++ b/04-fibonacci/index.js @@ -1,4 +1,12 @@ 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