Skip to content

Instantly share code, notes, and snippets.

@cesartl
Last active May 17, 2020 13:47
Show Gist options
  • Save cesartl/746f8e116051048bf82812dec39e8ac6 to your computer and use it in GitHub Desktop.
Save cesartl/746f8e116051048bf82812dec39e8ac6 to your computer and use it in GitHub Desktop.
Basic Fibonacci Implementation
fun fibonacciSlow(n: BigInteger) = when {
n <= BigInteger.ONE -> n
else -> fibonacciSlow(n - BigInteger.ONE) + fibonacciSlow(n - BigInteger.TWO)
}
@cesartl
Copy link
Author

cesartl commented May 17, 2020

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