Last active
May 17, 2020 13:47
-
-
Save cesartl/746f8e116051048bf82812dec39e8ac6 to your computer and use it in GitHub Desktop.
Basic Fibonacci Implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun fibonacciSlow(n: BigInteger) = when { | |
n <= BigInteger.ONE -> n | |
else -> fibonacciSlow(n - BigInteger.ONE) + fibonacciSlow(n - BigInteger.TWO) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sure good idea, I'll update it 👌