Permutations: Difference between revisions

(→‎{{header|Ruby}}: added another method)
(→‎{{header|Ruby}}: fixed typos)
Line 1,692:
</pre>
 
However, this method will produce indistinct permutationpermutations if the array has indictinct elements. If you need to find all the permutations of an array of which many elementelements are the same, the method below will be more efficient.
 
<lang ruby>