good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi Monks I want to divide a list of strings into substrings. Following rules should be met: * It must be able to set together each string with a set of substrings. * The length of each substring should be at least 3 characters. * The length ($len) of all substrings added together (+2 penalty for each substring) should be as small as possible.
An example: The list @list should give as result e.g. the list of substrings @expected_substrings. The length $len gives for this example 46.
Do you have any brilliant idea how to solve this without using long loops with many trials? Many Thanks In reply to Divide a list of string into substrings by Anonymous Monk
|
|