What is the best way to generate a random permutation of n numbers?
For example, say I have a set of numbers 1, 2 and 3 (n = 3)
Set of all possible permutati
You can try RubyCollect4J
Ruby.Array.of(1, 2, 3).permutation().toA().sample();
It did exactly what you asked for. BTW, I am the author of this Java library.