I want to find a problem like this:
Given a string s and array a of words, split s using words from a so that the least characters were left without matching to any of words.
So given s = 'aabbac' and a = {'aabb', 'c', 'aab', 'bac'} I expect s to be splited into not into because the last option gives me an extra character.
I am quite sure there is a problem like this somewhere in the web, but can anyone give me a link to it?
Thanks.
Here is the link
Medium https://oj.leetcode.com/problems/word-break/
Hard https://oj.leetcode.com/problems/word-break-ii/
Hope this may help you ...