Skip to content

Instantly share code, notes, and snippets.

@dimatarelkin
Last active November 30, 2017 13:59
Show Gist options
  • Save dimatarelkin/78cb2ff0d55074ee172ae7ea16f65c10 to your computer and use it in GitHub Desktop.
Save dimatarelkin/78cb2ff0d55074ee172ae7ea16f65c10 to your computer and use it in GitHub Desktop.
//returns Fibonacci member by number - n
func fib(_ n: Int) -> Int {
return n < 2 ? n : (fib(n-1) + fib(n-2))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment