Created
May 30, 2018 08:52
-
-
Save bijancn/a387cbdd838c35a04cb1b7be55710df7 to your computer and use it in GitHub Desktop.
Don't do this at home
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
def addThree(list: List[Int]): List[Int] = { | |
var i = 0 | |
var result = new ListBuffer[Int]() | |
while (i < list.length) { | |
result += list(i) + 3 | |
i += 1 | |
} | |
result.toList | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment