Sale
Summer Offer: $190/yr $99/yr
00 : 00 : 00 : 00
Get this deal
Backend Engineering Mid-Level programming

LeetCode #139 - Word Break: Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words. You may assume the dictionary does not contain duplicate words.

Input: s = "leetcode", wordDict = ["leet","code"]
Output: true
Input: s = "applepenapple", wordDict = ["apple","pen"]
Output: true
Constraints: 1 <= s.length <= 300
1 <= wordDict.length <= 1000
1 <= wordDict[i].length <= 20
Suggested Answer

Trusted by 100+ professionals preparing for interviews

Trusted by 100+ professionals 50+ Company Question Banks 5+ Supported Languages

Practice More Questions Like This

Generate unlimited interview questions with structured answers, code runner, and AI-powered walkthroughs.

Get Started Free

More Backend Engineering Interview Prep

LeetCode #293 - Flip Game
Backend Engineering · Mid-Level
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Link copied to clipboard