Extra Characters in a String
Implement `solve(arg1)`, where `arg1` is a string array whose first element is the target string `s` and whose remaining elements are dictionary words. Return the minimum number of characters left over when `s` is broken into contiguous substrings that appear in the dictionary. Characters that cannot be matched by any dictionary word in the chosen segmentation count as extra.