I want to transform the array [3, 4, 8]
→[3, 4, 8, 34, 38, 48, 43, 83, 84, 348, 384, 834, 843, 438, 483]
I tried array.permutation
but this only returns [348, 384, 834, 843, 438, 483]
. Is there a clean way of doing this without generating every possible subset first?