View difference between Paste ID: QZwHRUAz and 2rCQfKeY
SHOW: | | - or go back to the newest paste.
1-
Question 1:
1+
 def nthFibonacci(n : Int):Int = {
2-
In the preferred Scala style it almost always possible to avoid using explicit return statements. All expressions return a value so the first function could be written this:
2+
3-
3+
4-
 def nthFibonacci(n : Int): Int ={
4+