Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re (tilly) 2: (Golf) Per Mutations

by tilly (Archbishop)
on May 04, 2001 at 04:29 UTC ( #77849=note: print w/replies, xml ) Need Help??


in reply to Re: (Golf) Per Mutations
in thread (Golf) Per Mutations

Didn't the rules say arbitrary list? Try this with the list (1,2,3,1) and you get incorrect output.

However here is another 57 char solution that does not suffer from this deficiency.

sub p{ @_?map{my$x=shift;@r=map[$x,@$_],&p;push@_,$x;@r}1..@_:[] }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://77849]
help
Chatterbox?
[holli]: the inventor of Ramen should get a Nobel prize
[beech]: which one?
[holli]: chicken chillie Xtra hot :)

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2017-12-13 01:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (344 votes). Check out past polls.

    Notices?