17.14 Oh, no! You had just completed a lengthy document when you had an unfortunate find/replace mishap. You are accidentally removed all spaces, punctuation, and capitalization in the document. A sentence like "I Reset the computer. It still didn ' t boot! "would become" iresetthecomputeritstilldidntboot ". You can add the punctation and capitalization later, once you get the individual words properly SE Parated. Most of the words would be in a dictionary, but some strings, like proper names, would not.
Given A dictionary (a list of words), design an algorithm to find the optimal of the "unconcatenating" a sequence of words . In this case, "optimal" are defined to be the parsing which minimizes the number of unrecognized sequences of characters.
For example, the string "Jesslookedjustliketimherbrother" would is optimally parsed as "JESS looked just like TIM she Brot Her. " This parsing has seven unrecognized characters, which we had capitalized for clarity.
[Careercup] 17.14 unconcatenate Words broken Words