feat: funcao fibonacci
This commit is contained in:
parent
18edddd101
commit
2954160e87
@ -1,4 +1,10 @@
|
||||
export function fibonacci(value) {
|
||||
// implementar logica aqui
|
||||
|
||||
}
|
||||
if (value < 1) {
|
||||
return 0
|
||||
} else if (value <= 2) {
|
||||
return 1
|
||||
} else {
|
||||
return (fibonacci(value - 1) + fibonacci(value - 2))
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user