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) | |
} |
Sure good idea, I'll update it 👌
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think it would be better to write it this way:
I think it's better to take full advantage of the capabilities and syntax of the language for your demonstrations ^^