... 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:
Extra Credit: Provide a solution the runs in polynomial time ;)sub assemble { ... } assemble qw(logger gerbil log analog) # analoggerbil assemble qw(GATTACA ATTACA GATT AAGAT CCC) # CCCAAGATTACA # .. or # AAGATTACACCC
MeowChow s aamecha.s a..a\u$&owag.print
Back to
Meditations