mirror of
https://github.com/devenperez/leetcode.git
synced 2026-06-13 23:07:08 +00:00
Create README - LeetHub
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<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> follows the same pattern.</p>
|
||||
|
||||
<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>
|
||||
|
||||
<p> </p>
|
||||
<p><strong class="example">Example 1:</strong></p>
|
||||
|
||||
<pre><strong>Input:</strong> pattern = "abba", s = "dog cat cat dog"
|
||||
<strong>Output:</strong> true
|
||||
</pre>
|
||||
|
||||
<p><strong class="example">Example 2:</strong></p>
|
||||
|
||||
<pre><strong>Input:</strong> pattern = "abba", s = "dog cat cat fish"
|
||||
<strong>Output:</strong> false
|
||||
</pre>
|
||||
|
||||
<p><strong class="example">Example 3:</strong></p>
|
||||
|
||||
<pre><strong>Input:</strong> pattern = "aaaa", s = "dog cat cat dog"
|
||||
<strong>Output:</strong> false
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Constraints:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>1 <= pattern.length <= 300</code></li>
|
||||
<li><code>pattern</code> contains only lower-case English letters.</li>
|
||||
<li><code>1 <= s.length <= 3000</code></li>
|
||||
<li><code>s</code> contains only lowercase English letters and spaces <code>' '</code>.</li>
|
||||
<li><code>s</code> <strong>does not contain</strong> any leading or trailing spaces.</li>
|
||||
<li>All the words in <code>s</code> are separated by a <strong>single space</strong>.</li>
|
||||
</ul>
|
||||
</div>
|
||||
Reference in New Issue
Block a user