scala - Composing a list of pairs -


i have list in scala following: list(1,2,3,4)

how can generate list of tuples of pairs of elements running end result follows:

list((1,2), (1,3), (1,4), (2,3), (2,4), (3,4))

is there built in function produce such result?

there combination method in list, this

list(1,2,3,4).combinations(2).tolist 

Comments

Popular posts from this blog

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -