Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Golf for unique digits

by space_monk (Chaplain)
on Jan 09, 2013 at 11:47 UTC ( #1012457=note: print w/ replies, xml ) Need Help??


in reply to Golf for unique digits

choroba's method with ampersands and removing variable

perl -E'2213=~/$_/&&$c++for 0..9;say$c'
A Monk aims to give answers to those who have none, and to learn from those who know more.


Comment on Re: Golf for unique digits
Download Code
Re^2: Golf for unique digits
by trizen (Friar) on Jan 09, 2013 at 18:28 UTC
    Even shorter: perl -E'say~~grep+2013=~$_,0..9'

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2015-05-04 15:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    In my home, the TV remote control is ...









    Results (93 votes), past polls