Created
February 14, 2022 19:55
-
-
Save reevik/d5d05bea1a6427245b73a4b0217b5fda 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.map(e => List(e - 1, e, e + 1)) | |
> res0: List[List[Int]] = List(List(0, 1, 2), List(1, 2, 3), List(2, 3, 4), List(3, 4, 5), List(4, 5, 6)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment