Skip to content

Commit c8ceb1b

Browse files
author
NHibiki
committed
fix fibonacci problem
1 parent 044c493 commit c8ceb1b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sketch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function anomalyCode(x) {
3131

3232
function nOfFibonacci(x) {
3333
let n = parseInt(x, 10);
34-
return (!n || n < 1) ? -1 : (n < 4 ? 1 : (nOfFibonacci(n-1) + nOfFibonacci(n-2)));
34+
return (!n || n < 1) ? -1 : (n < 3 ? 1 : (nOfFibonacci(n-1) + nOfFibonacci(n-2)));
3535
}
3636

3737
module.exports = {

0 commit comments

Comments
 (0)