in reply to Re^4: Permutation with repetitions
in thread Permutation with repetitions
If you need those, I think I can find a shortcut. Think of such a string as a 4 digit number, in base 4, with an a posteriori mapping of
or, in Perl code:( 0 => 'a', 1 => 'b', 2 => 'c', 3 => 'd' )
so all you really need is a 4 digit base 4 counter and this mapping. If you don't want to code this by hand, you might make use of a module like the one I found using a quick Google search, Math::BaseArith.tr/0-3/a-d/
|
|---|