Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: substrings that consist of repeating charactersby LanX (Saint) |
on Sep 27, 2020 at 20:06 UTC ( [id://11122270]=note: print w/replies, xml ) | Need Help?? |
The simplest way to do it, demonstrated in the debugger
Storing the length in @substr for a Schwartzian transform might be faster, but I wouldn't bet on this. IMHO is length only doing a simple lookup of the pre-calculated length inside Perl's data-structure for strings and should be pretty fast. HTH! :)
Cheers Rolf
updateyou could also do sort and dump in one line:
In Section
Seekers of Perl Wisdom
|
|