6 kyu

Fibonacci Reloaded

1,168 of 2,293BattleRattle

Description:

And here is Fibonacci again. This time we want to go one step further. Our fib() function must be faster! Can you do it?

In case you don't know, what the Fibonacci number is:

The nth Fibonacci number is defined by the sum of the two previous Fibonacci numbers. In our case: fib(1) := 0 and fib(2) := 1. With these initial values you should be able to calculate each following Fibonacci number.

Examples:

fib(1) // === 0
fib(2) // === 1
fib(3) // === 1
fib(4) // === 2
fib(5) // === 3
Algorithms

Stats:

CreatedOct 9, 2013
PublishedOct 9, 2013
Warriors Trained3747
Total Skips222
Total Code Submissions8842
Total Times Completed2293
JavaScript Completions1168
Ruby Completions107
Python Completions1003
Haskell Completions75
Total Stars61
% of votes with a positive feedback rating89% of 459
Total "Very Satisfied" Votes375
Total "Somewhat Satisfied" Votes64
Total "Not Satisfied" Votes20
Ad
Contributors
  • BattleRattle Avatar
  • jhoffner Avatar
  • GiacomoSorbi Avatar
  • anter69 Avatar
  • JohanWiltink Avatar
  • Firefly2002 Avatar
  • user9644768 Avatar
  • cliffstamp Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad