Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def nthFibonacci(n : Int):Int = {
- if (n == 1 || n == 2) n
- else nthFibonacci(n-1) + nthFibonacci(n-2)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement