Permutations: Difference between revisions

J
(J)
Line 4:
 
(c.f. [[Find the missing permutation]] )
=={{header|J}}==
 
<lang j>perms=: A.&i.~ !</lang>
 
Example use:
 
<lang j> perms 2
0 1
1 0
({~ perms@#)&.;: 'some random text'
some random text
some text random
random some text
random text some
text some random
text random some</lang>
 
=={{header|Java}}==
Using the code of [http://www.merriampark.com/perm.htm Michael Gilleland.]
6,951

edits