You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h2><ahref="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>
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> </p>
6
+
<p><strongclass="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><strongclass="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><strongclass="example">Example 3:</strong></p>
19
+
20
+
<pre><strong>Input:</strong> pattern = "aaaa", s = "dog cat cat dog"
0 commit comments