Word break II: every way to split a sentence

0
Remix

Given a string and a dictionary of words, return every sentence you can form by splitting the string into dictionary words, with words separated by spaces. Words may be reused. Memoize so shared suffixes are not solved twice, and discuss how large the output can get.

AmazonTechnical phone screenLast asked Jan 2026
No answer yet. Write the first one; the best answer gets endorsed.