Skip to content

Commit d4bb2f6

Browse files
committed
Create README - LeetHub
1 parent ac8fb6f commit d4bb2f6

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

0290-word-pattern/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<h2><a href="https://leetcode.com/problems/word-pattern/">290. Word Pattern</a></h2><h3>Easy</h3><hr><div><p>Given a <code>pattern</code> and a string <code>s</code>, find if <code>s</code>&nbsp;follows the same pattern.</p>
2+
3+
<p>Here <b>follow</b> means a full match, such that there is a bijection between a letter in <code>pattern</code> and a <b>non-empty</b> word in <code>s</code>.</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
8+
<pre><strong>Input:</strong> pattern = "abba", s = "dog cat cat dog"
9+
<strong>Output:</strong> true
10+
</pre>
11+
12+
<p><strong class="example">Example 2:</strong></p>
13+
14+
<pre><strong>Input:</strong> pattern = "abba", s = "dog cat cat fish"
15+
<strong>Output:</strong> false
16+
</pre>
17+
18+
<p><strong class="example">Example 3:</strong></p>
19+
20+
<pre><strong>Input:</strong> pattern = "aaaa", s = "dog cat cat dog"
21+
<strong>Output:</strong> false
22+
</pre>
23+
24+
<p>&nbsp;</p>
25+
<p><strong>Constraints:</strong></p>
26+
27+
<ul>
28+
<li><code>1 &lt;= pattern.length &lt;= 300</code></li>
29+
<li><code>pattern</code> contains only lower-case English letters.</li>
30+
<li><code>1 &lt;= s.length &lt;= 3000</code></li>
31+
<li><code>s</code> contains only lowercase English letters and spaces <code>' '</code>.</li>
32+
<li><code>s</code> <strong>does not contain</strong> any leading or trailing spaces.</li>
33+
<li>All the words in <code>s</code> are separated by a <strong>single space</strong>.</li>
34+
</ul>
35+
</div>

0 commit comments

Comments
 (0)