Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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.

Replies are listed 'Best First'.
Re^2: Golf for unique digits
by trizen (Hermit) 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?
[shmem]: hm. That should be "an artist's expression"
[RonW]: Happy Thanksgiving Eve
[RonW]: and no panic, here. We're staying home, safe from the frenzy in the stores
[AnomalousMonk]: choroba: It even has Rama's (relatively) high rate of spin, although I don't know if it's axial spin.

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (12)
As of 2017-11-22 16:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (327 votes). Check out past polls.

    Notices?