Medium · Dynamic programming

Word Break

You are given a string, s, and a list of words. Return whether s can be cut into pieces so that every piece is one of the words.

  • A word can be used more than once.
  • Not every word has to be used.
  • Everything is lowercase letters.
s     = "leetcode"
words = ["leet", "code"]

→ true   (leet + code)
Record your take

No one has solved it yet.