Oh, no! You have just completed a lengthy document when you have an unfortu-nate Find/Replace mishap. You have accidentally removed all spac ...
Oh, no! You have just completed a lengthy document when you have an unfortu-nate Find/Replace mishap. You have accidentally removed all spaces, punctuation,and capitalization in the document. A sentence like "I reset the computer. It stilldidn't boot!" would become "iresetthecomputeritstilldidntboot". You figure that youcan add back in the punctation and capitalization later, once you get the individualwords properly separated. Most of the words will be in a dictionary, but some strings,like proper names, will not.Given a dictionary (a list of words), design an algorithm to find the optimal way of"unconcatenating" a sequence of words. In this case, "optimal" is defined to be theparsing which minimizes the number of unrecognized sequences of characters.For example, the string "jesslookedjustliketimherbrother" would be optimally parsedas "JESS looked just like TIM her brother". This parsing has seven unrecognized char-acters, which we have capitalized for clarity.
原标题:CareerCup: 17.14 minimize unrecognized characters
关键词:
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。