Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^2: list of four digit lock combinations without repeated digitsby usemodperl (Beadle) |
on Jun 21, 2018 at 01:23 UTC ( [id://1217086]=note: print w/replies, xml ) | Need Help?? |
> it generates these kinds of patterns very efficiently
I tried Algorithm::Combinatorics for a similar task. Both of these examples generate an array of strings n characters in length of all combinations of letters (e.g. 4 = 'aaaa'..'zzzz'). Am I doing something stupid with the module, or perl? Perl string iteration: real 0m0.129s Using Algorithm::Combinatorics: real 0m0.858s Be careful with the parameter because this can make a very big array. 4 is only ~2MB but 5 is 70MB and the 6 character array is around 2000MB.
In Section
Seekers of Perl Wisdom
|
|