perlmeditation
MeowChow
... aka <i>DNA Sequencing</i> or <i>Shortest Common Superstring</i>. Your mission, should you choose to accept it, is to design a golfed subroutine that reassembles a list of string fragments into a <b>minimal</b> length string which contains all those string fragments as substrings.
<p>
For example:
<code>
sub assemble { ... }
assemble qw(logger gerbil log analog)
# analoggerbil
assemble qw(GATTACA ATTACA GATT AAGAT CCC)
# CCCAAGATTACA
# .. or
# AAGATTACACCC
</code>
<b>Extra Credit</b>: Provide a solution the runs in polynomial time ;)
<pre>
<a href="/index.pl?node=MeowChow"> MeowChow </a>
s aamecha.s a..a\u$&owag.print</pre>