Skip to content

Commit bc2973c

Browse files
committed
Create README - LeetHub
1 parent 8e6f00b commit bc2973c

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

0139-word-break/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<h2><a href="https://leetcode.com/problems/word-break/">139. Word Breaka>h2><h3>Mediumh3><hr><p>Given a string <code>scode> and a dictionary of strings <code>wordDictcode>, return <code>truecode> if <code>scode> can be segmented into a space-separated sequence of one or more dictionary words.p>
2+
3+
<p><strong>Notestrong> that the same word in the dictionary may be reused multiple times in the segmentation.p>
4+
5+
<p>&nbsp;p>
6+
<p><strong class="example">Example 1:strong>p>
7+
8+
<pre>
9+
<strong>Input:strong> s = &quot;leetcode&quot;, wordDict = [&quot;leet&quot;,&quot;code&quot;]
10+
<strong>Output:strong> true
11+
<strong>Explanation:strong> Return true because &quot;leetcode&quot; can be segmented as &quot;leet code&quot;.
12+
pre>
13+
14+
<p><strong class="example">Example 2:strong>p>
15+
16+
<pre>
17+
<strong>Input:strong> s = &quot;applepenapple&quot;, wordDict = [&quot;apple&quot;,&quot;pen&quot;]
18+
<strong>Output:strong> true
19+
<strong>Explanation:strong> Return true because &quot;applepenapple&quot; can be segmented as &quot;apple pen apple&quot;.
20+
Note that you are allowed to reuse a dictionary word.
21+
pre>
22+
23+
<p><strong class="example">Example 3:strong>p>
24+
25+
<pre>
26+
<strong>Input:strong> s = &quot;catsandog&quot;, wordDict = [&quot;cats&quot;,&quot;dog&quot;,&quot;sand&quot;,&quot;and&quot;,&quot;cat&quot;]
27+
<strong>Output:strong> false
28+
pre>
29+
30+
<p>&nbsp;p>
31+
<p><strong>Constraints:strong>p>
32+
33+
<ul>
34+
  • 1 <= s.length <= 300
  • 35+
  • 1 <= wordDict.length <= 1000
  • 36+
  • 1 <= wordDict[i].length <= 20
  • 37+
  • s and wordDict[i] consist of only lowercase English letters.
  • 38+
  • All the strings of wordDict are unique.
  • 39+
    ul>

    0 commit comments

    Comments
     (0)