forked from M3-Academy/challenge-algorithms-v2.0
feat: Adiciona 04-fibonacci
This commit is contained in:
parent
993dfe0924
commit
c0b30c28d8
@ -1,4 +1,9 @@
|
|||||||
export function fibonacci(value) {
|
export function fibonacci(value) {
|
||||||
// implementar logica aqui
|
// implementar logica aqui
|
||||||
|
|
||||||
}
|
if (value === 0 || value === 1) {
|
||||||
|
return value;
|
||||||
|
} else {
|
||||||
|
return fibonacci(value - 1) + fibonacci(value - 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user