Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Re: (Efficiency Golf) Triangular numbers

by Zaxo (Archbishop)
on Jun 01, 2001 at 00:06 UTC ( #84721=note: print w/ replies, xml ) Need Help??

in reply to Re: (Efficiency Golf) Triangular numbers
in thread (Efficiency Golf) Triangular numbers

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.

Comment on Re: Re: (Efficiency Golf) Triangular numbers

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://84721]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2015-11-25 07:50 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (672 votes), past polls