Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vincent-pradeilles/b005a1ab9fb75ee3a2cc0e79aea82463 to your computer and use it in GitHub Desktop.
Save vincent-pradeilles/b005a1ab9fb75ee3a2cc0e79aea82463 to your computer and use it in GitHub Desktop.
func fib(_ n: Int) -> Int {
if n == 0 || n == 1 {
return 1
} else {
return fib(n - 1) + fib(n - 2)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment