Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: GOLF: Input sort list of integers, Output as [356853]

by EvdB (Deacon)
on May 27, 2004 at 14:48 UTC ( #356922=note: print w/replies, xml ) Need Help??


in reply to GOLF: Input sort list of integers, Output as [356853]

After much fun down to 44.
# 1 2 3 4 5 #1234567890123456789012345678901234567890123456789012345678 #map{$j=0 if$l!=$_&&print'';print++$i.") $_-".++$j;$l=$_}@_ #map{print$j=''if$l!=$_;print++$i.") $_-".++$j;$l=$_}@_ #map{print''if!$A{$_};print++$i.") $_-".++$A{$_}}@_ print$A{$_}?'':$/,++$i.") $_-".++$A{$_}for@_
Update 1: Now down to 43:
print!$A{$_}&&$/,++$i.") $_-".++$A{$_}for@_
Update 2: Now down to 42:
print!$A{$_}++&&$/,++$i.") $_-$A{$_}"for@_
Update 3: Now 41 (Inspired by Abigail-II):
print$/x!$A{$_}++,++$i.") $_-$A{$_}"for@_

--tidiness is the memory loss of environmental mnemonics

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://356922]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2016-12-07 11:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (125 votes). Check out past polls.