forked from M3-Academy/challenge-algorithms-v2.0
Merge pull request 'develop' (#2) from develop into master
Reviewed-on: #2
This commit is contained in:
commit
c24b792541
@ -1,7 +1,10 @@
|
||||
export function fibonacci(value) {
|
||||
// implementar logica aqui
|
||||
if (value <= 1) {
|
||||
return value;
|
||||
const fib = [0,1]
|
||||
let i = 1
|
||||
while (value > fib.length-1){
|
||||
fib.push(fib[i - 1] + fib[i])
|
||||
i ++
|
||||
}
|
||||
return fibonacci(value -1 ) + fibonacci(value -2)
|
||||
return fib[value]
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
export function isPrime(value) {
|
||||
// implementar logica aqui
|
||||
|
||||
if(value === 1){
|
||||
return false
|
||||
}else{
|
||||
|
Loading…
Reference in New Issue
Block a user