Soal
00:00

28. Word Break

SedangPemrograman dinamisAmazonGoogle

Determine whether s can be segmented into one or more words from wordDict.

Contoh 1:

Input: s = "leetcode", wordDict = ["leet","code"]
Output: true

Contoh 2:

Input: s = "catsandog", wordDict = ["cats","dog","sand","and","cat"]
Output: false

Batasan:

  • 1 <= s.length <= 300
  • 1 <= wordDict.length <= 1000
Mode kode inti
● Tersimpan otomatisBaris 1, kolom 1