|The stupid question is the question not asked|
Divide a list of string into substringsby Anonymous Monk
|on Jun 20, 2020 at 19:23 UTC||Need Help??|
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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?