Just another Perl shrine | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
If anyone has an elegant way of deleting the cases where we have duplicate characters I would love to see it. My 2 line regex is functional, but fairly agricultural!
I won't claim elegance, but above I constructed character classes on the fly for that. Each partial solution like ($T,$H,$R,$E,$N) is used to form "[^$T$H$R$E$N]". That is applied to 3-digit candidates which are already filtered for unlike digits. After Compline Update: Rereading your statement, I saw I'd filtered that too :-) I used $_ !~ m/(\d)\d*\1/g to filter out matching digits. In reply to Re: Re: (Efficiency Golf) Triangular numbers
by Zaxo
|
|