1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-18 11:36:48 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

更新国内版力扣题目描述变更

This commit is contained in:
2022-05-02 23:42:43 +08:00
parent 74598d1cf8
commit 7ea03594b3
198 changed files with 11378 additions and 11118 deletions

View File

@@ -1,38 +1,38 @@
<p>You are given two strings, pattern and value. The pattern string consists of just the letters a and b, describing a pattern within a string. For example, the string catcatgocatgo matches the pattern aabab (where cat is a and go is b). It also matches patterns like a, ab, and b. Write a method to determine if value matches pattern. a and b cannot be the same string.</p>
<p><strong>Example 1: </strong></p>
<pre>
<strong>Input: </strong> pattern = &quot;abba&quot;, value = &quot;dogcatcatdog&quot;
<strong>Output: </strong> true
</pre>
<p><strong>Example 2: </strong></p>
<pre>
<strong>Input: </strong> pattern = &quot;abba&quot;, value = &quot;dogcatcatfish&quot;
<strong>Output: </strong> false
</pre>
<p><strong>Example 3: </strong></p>
<pre>
<strong>Input: </strong> pattern = &quot;aaaa&quot;, value = &quot;dogcatcatdog&quot;
<strong>Output: </strong> false
</pre>
<p><strong>Example 4: </strong></p>
<pre>
<strong>Input: </strong> pattern = &quot;abba&quot;, value = &quot;dogdogdogdog&quot;
<strong>Output: </strong> true
<strong>Explanation: </strong> &quot;a&quot;=&quot;dogdog&quot;,b=&quot;&quot;vice versa.
</pre>
<p><strong>Note: </strong></p>
<ul>
<li><code>0 &lt;= len(pattern) &lt;= 1000</code></li>
<li><code>0 &lt;= len(value) &lt;= 1000</code></li>
<li><code>pattern</code>&nbsp;only contains&nbsp;<code>&quot;a&quot;</code>&nbsp;and&nbsp;<code>&quot;b&quot;</code>,&nbsp;<code>value</code> only contains lowercase letters.</li>
</ul>
<p>You are given two strings, pattern and value. The pattern string consists of just the letters a and b, describing a pattern within a string. For example, the string catcatgocatgo matches the pattern aabab (where cat is a and go is b). It also matches patterns like a, ab, and b. Write a method to determine if value matches pattern. a and b cannot be the same string.</p>
<p><strong>Example 1: </strong></p>
<pre>
<strong>Input: </strong> pattern = &quot;abba&quot;, value = &quot;dogcatcatdog&quot;
<strong>Output: </strong> true
</pre>
<p><strong>Example 2: </strong></p>
<pre>
<strong>Input: </strong> pattern = &quot;abba&quot;, value = &quot;dogcatcatfish&quot;
<strong>Output: </strong> false
</pre>
<p><strong>Example 3: </strong></p>
<pre>