Scala List All Permutations

[Solved] Scala List All Permutations | Scala - Code Explorer | yomemimo.com
Question : scala list all permutations

Answered by : z0san

scala> List(1,2,3).permutations.mkString("\n")
res3: String =
List(1, 2, 3)
List(1, 3, 2)
List(2, 1, 3)
List(2, 3, 1)
List(3, 1, 2)
List(3, 2, 1)

Source : https://stackoverflow.com/questions/8124440/code-to-enumerate-permutations-in-scala | Last Update : Sun, 10 Apr 22

Answers related to scala list all permutations

Code Explorer Popular Question For Scala