Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bc2973c

Browse files
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 Break</a></h2><h3>Medium</h3><hr><p>Given a string <code>s</code> and a dictionary of strings <code>wordDict</code>, return <code>true</code> if <code>s</code> can be segmented into a space-separated sequence of one or more dictionary words.</p>
2+
3+
<p><strong>Note</strong> 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+
<li><code>1 &lt;= s.length &lt;= 300</code></li>
35+
<li><code>1 &lt;= wordDict.length &lt;= 1000</code></li>
36+
<li><code>1 &lt;= wordDict[i].length &lt;= 20</code></li>
37+
<li><code>s</code> and <code>wordDict[i]</code> consist of only lowercase English letters.</li>
38+
<li>All the strings of <code>wordDict</code> are <strong>unique</strong>.</li>
39+
</ul>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /