<p>Oh, no! You have accidentally removed all spaces, punctuation, and capitalization in a lengthy document. A sentence like "I reset the computer. It still didn't boot!" became "iresetthecomputeritstilldidntboot''. You'll deal with the punctuation and capi­talization later; right now you need to re-insert the spaces. Most of the words are in a dictionary but a few are not. Given a dictionary (a list of strings) and the document (a string), design an algorithm to unconcatenate the document in a way that minimizes the number of unrecognized characters. Return the number of unrecognized characters.</p>
<p><strong>Note: </strong>This problem is slightly different from the original one in the book.</p>
<strong>Explanation: </strong> After unconcatenating, we got "<strong>jess</strong> looked just like <strong>tim</strong> her brother", which containing 7 unrecognized characters.
<li><code><fontface="sans-serif, Arial, Verdana, Trebuchet MS">The total number of characters in </font>dictionary</code> is less than or equal to 150000.</li>
<li>There are only lowercase letters in <code>dictionary</code> and <code>sentence</code>.</li>