Search
⌘K

Leetcode 139. Word Break

Determine whether the string s can be segmented into a sequence of one or more words from wordDict (words may be reused). The core challenge is prefix segmentation/reachability over string indices, typically solved with DP or BFS using the dictionary (max word length ≤ 20 limits checks).

Asked at:

Google

Google

T

tala

Meta

Microsoft

Microsoft


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late March, 2026

Google

Google

Junior

I was asked a slight variation of this question. The only difference was that wordDict was set of known elements of maximum length of 3. So I had to make the word using any of those parts, but those parts were only 1, 2 and 3 characters long. The solution for WordBreak works actually there.

Early March, 2026

T

tala

Mid-level

Early January, 2026

Microsoft

Microsoft

Senior

Your account is free and you can post anonymously if you choose.