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 n
th 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
Similar Kata:
Stats:
Created | Oct 9, 2013 |
Published | Oct 9, 2013 |
Warriors Trained | 3747 |
Total Skips | 222 |
Total Code Submissions | 8842 |
Total Times Completed | 2293 |
JavaScript Completions | 1168 |
Ruby Completions | 107 |
Python Completions | 1003 |
Haskell Completions | 75 |
Total Stars | 61 |
% of votes with a positive feedback rating | 89% of 459 |
Total "Very Satisfied" Votes | 375 |
Total "Somewhat Satisfied" Votes | 64 |
Total "Not Satisfied" Votes | 20 |