End of Year Sale: Use Coupon Code END2025 to Get Extra 25% Off.
wordDict into a set words for constant-time lookups.0 and a set seen to keep track of visited nodes.start.start equals the length of s, return true.start + 1 to the length of s:
end, if it has not been visited and the substring s[start:end] is in words, enqueue end and mark it as seen.false.