From ba28e130cedce309bb3d36f7b3ab6b725b2d5685 Mon Sep 17 00:00:00 2001 From: Gary Sztajnman Date: Sat, 1 Feb 2020 15:31:54 -0500 Subject: [PATCH] Fixing the Fibonacci formula Fibonacci of 0 should be 0 --- complex-elastic-beanstalk/worker/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/complex-elastic-beanstalk/worker/index.js b/complex-elastic-beanstalk/worker/index.js index ca56cdd..ddf319e 100644 --- a/complex-elastic-beanstalk/worker/index.js +++ b/complex-elastic-beanstalk/worker/index.js @@ -9,7 +9,7 @@ const redisClient = redis.createClient({ const sub = redisClient.duplicate(); function fib(index) { - if (index < 2) return 1; + if (index < 2) return index; return fib(index - 1) + fib(index - 2); }