Last active
February 14, 2022 19:54
-
-
Save reevik/e8a1f5b7eca5f01ede63ec18ee6bdeba to your computer and use it in GitHub Desktop.
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
val list = List(1,2,3,4,5) | |
list.flatMap(e => List(e - 1, e, e + 1)) | |
> res0: List[Int] = List(0, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 5, 6) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment