mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-03 22:42:52 +08:00
存量题库数据更新
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<p>Two strings <code>X</code> and <code>Y</code> are similar if we can swap two letters (in different positions) of <code>X</code>, so that it equals <code>Y</code>. Also two strings <code>X</code> and <code>Y</code> are similar if they are equal.</p>
|
||||
<p>Two strings, <code>X</code> and <code>Y</code>, are considered similar if either they are identical or we can make them equivalent by swapping at most two letters (in distinct positions) within the string <code>X</code>.</p>
|
||||
|
||||
<p>For example, <code>"tars"</code> and <code>"rats"</code> are similar (swapping at positions <code>0</code> and <code>2</code>), and <code>"rats"</code> and <code>"arts"</code> are similar, but <code>"star"</code> is not similar to <code>"tars"</code>, <code>"rats"</code>, or <code>"arts"</code>.</p>
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
<p>We are given a list <code>strs</code> of strings where every string in <code>strs</code> is an anagram of every other string in <code>strs</code>. How many groups are there?</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
<p><strong class="example">Example 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> strs = ["tars","rats","arts","star"]
|
||||
<strong>Output:</strong> 2
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
<p><strong class="example">Example 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> strs = ["omv","ovm"]
|
||||
|
Reference in New Issue
Block a user