Given a string s
, break s
such that every partition can be found in the dictionary. Return the minimum number of breaks needed.
Given a dictionary ["Cat", "Mat", "Ca", "tM", "at", "C", "Dog", "og", "Do"]
and string "CatMat"
, the output should be 1
since we can partition the string as ["Cat", "Mat"]
.