Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SCALA

scala list all permutations

scala> List(1,2,3).permutations.mkString("
")
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 by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #scala #list #permutations
ADD COMMENT
Topic
Name
4+4 =