0

Optimally break a string into substrings
code-golf string optimization
Given a string, like potatocarrot, optimally break it into substrings. These substrings can consist of either a single character, or one of a list of substrings passed as input. For example, if [carrot, potato] was the input, ...