develop #12

Merged
Rhayllon_Daudt merged 22 commits from develop into master 2022-11-01 00:35:27 +00:00
Showing only changes of commit 42c6514828 - Show all commits

View File

@ -3,5 +3,11 @@ export function fibonacci(value) {
if(value <= 1){
return value
}
return fibonacci(value - 1) + fibonacci(value - 2)
let v1 = 0, v2 = 1, v3 = 1;
for (let i = 2; i <= value ; i++) {
v3 = v1 + v2;
v1 = v2;
v2 = v3
}
return v3;
}