>_
word_break.ts
TypeScript 5.9
Not run yet

+ 7 hidden

Input
s = "paintpaintbrush"
words = ["brush", "paint", "pain", "rush"]
Expected
true

paint + paint + brush covers the whole string, using paint twice.