Movatterモバイル変換


[0]ホーム

URL:


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

Commitbc2973c

Browse files
committed
Create README - LeetHub
1 parent8e6f00b commitbc2973c

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><ahref="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><strongclass="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><strongclass="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><strongclass="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)

[8]ページ先頭

©2009-2025 Movatter.jp