dev #1

Merged
matheusbrollodauter merged 11 commits from dev into master 2022-11-02 16:07:43 +00:00
2 changed files with 12 additions and 2 deletions
Showing only changes of commit 47142e3085 - Show all commits

View File

@ -1,4 +1,4 @@
export function maxValue(values) {
// implementar logica aqui
return Math.max(...values);
}

View File

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