http://www.perlmonks.org?node_id=77183

... aka DNA Sequencing or Shortest Common Superstring. Your mission, should you choose to accept it, is to design a golfed subroutine that reassembles a list of string fragments into a minimal length string which contains all those string fragments as substrings.

For example:

sub assemble { ... } assemble qw(logger gerbil log analog) # analoggerbil assemble qw(GATTACA ATTACA GATT AAGAT CCC) # CCCAAGATTACA # .. or # AAGATTACACCC
Extra Credit: Provide a solution the runs in polynomial time ;)
   MeowChow                                   
               s aamecha.s a..a\u$&owag.print