Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2016-09-29 19:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (559 votes). Check out past polls.