Created
August 25, 2016 21:59
-
-
Save dtrailin/5ebba8ff2cfcfd34aaa6b26f795dedd5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| tailrec fun fib(count: Long, seq: List<Int> = listOf(1,1)): List<Int> = | |
| if (seq.size >= count) seq else fib(count, seq + (seq.last() + seq[seq.lastIndex - 1])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment