Created
November 29, 2017 05:13
-
-
Save carlogilmar/16979cf0b4909f66c7f8af74b1493c62 to your computer and use it in GitHub Desktop.
Fibonacci First Solution
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
func fib1(n: UInt) -> UInt { | |
if(n<2){ | |
return n | |
} | |
return fib1(n: n-2) + fib1(n: n-1) | |
} | |
fib1(n: 20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment