-
-
Save maniish-jaiin/e0e0ab3d97765e22958e4dee33b90768 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
| fun fibonacciFold(n: Int) = | |
| (2 until n).fold(1 to 1) { (prev, curr), _ -> | |
| curr to (prev + curr) | |
| }.second |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment