Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 511 Bytes

File metadata and controls

17 lines (13 loc) · 511 Bytes

Problem 13: The Word Breaker (Word Break)

Problem Statement

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.

Input Format

  • A string s.
  • A list of strings wordDict.

Constraints

  • 1 <= s.length <= 300
  • 1 <= wordDict.length <= 1000

Example

Input: s = "leetcode", wordDict = ["leet","code"]
Output: True
Explanation: "leetcode" can be segmented as "leet code".