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

Re: Golf for unique digits

by LanX (Canon)
on Jan 09, 2013 at 11:41 UTC ( #1012452=note: print w/ replies, xml ) Need Help??


in reply to Golf for unique digits

> perl -E'$_=2013;@h{split//}=();say 0+keys%h' 4

UPDATE: please ignore, breaks the rulez

Cheers Rolf


Comment on Re: Golf for unique digits
Download Code
Re^2: Golf for unique digits
by choroba (Abbot) on Jan 09, 2013 at 11:45 UTC
    Isn't this the %uniq method?
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      it is!

      I oversaw the skipping the %unique method part... sorry! =)

      Cheers Rolf

Re^2: Golf for unique digits
by LanX (Canon) on Jan 09, 2013 at 12:25 UTC
    as a compensation a new approach: =)

    > perl -ple'$_=join"",sort split//;y///cs;$_=length' 1987 4 1988 3 2012 3 2013 4

    EDIT: shortened the say away...

    Cheers Rolf

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2014-07-24 14:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (160 votes), past polls