I have to generate all variations without repetitions made of digits 0 - 9.
Length of them could be from 1 to 10. I really don\'t know how to solve it, especially ho
using Dollar it is simple:
@Test
public void generatePermutations() {
// digits is the string "0123456789"
String digits = $('0', '9').join();
// then generate 10 permutations
for (int i : $(10)) {
// shuffle, the cut (0, 4) in order to get a 4-char permutation
System.out.println($(digits).shuffle().slice(4));
}
}