Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: (Golf) Fragment Reassembly

by indigo (Scribe)
on May 03, 2001 at 04:13 UTC ( #77535=note: print w/ replies, xml ) Need Help??


in reply to (Golf) Fragment Reassembly

92, although I suspect it may not run in polynomial time...:)

sub assemble {$l=eval(join'+',map{y===c}@_);for$x('a'..'z'x$l,'A'..'Z'x$l){return$x + if!grep{$x!~/$_/}@_}}


Comment on Re: (Golf) Fragment Reassembly
Download Code
Re: Re: (Golf) Fragment Reassembly
by dws (Chancellor) on May 03, 2001 at 04:43 UTC
    When I try to invoke this via   print assemble qw(GATTACA ATTACA GATT AAGAT CCC);
    I get   Modification of a read-only value attempted at indigo.pl line 2.
    If I pass a copy of the array, Perl runs out of memory (PIII-600, 256Mb, ActiveState Perl 5.6.0).

    The map looks suspicious.

      I'd strongly recommend not running this one with strings of length greater than 2...:)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2014-12-19 01:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (69 votes), past polls