mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-22 05:26:46 +08:00
update
This commit is contained in:
@@ -7,12 +7,12 @@
|
||||
"boundTopicId": 910311,
|
||||
"title": "相似的字符串",
|
||||
"titleSlug": "H6lPxb",
|
||||
"content": "<p>English description is not available for the problem. Please switch to Chinese.</p>\n",
|
||||
"content": "<p>English description is not available for the problem. Please switch to Chinese.</p>",
|
||||
"translatedTitle": "相似的字符串",
|
||||
"translatedContent": "<p>如果交换字符串 <code>X</code> 中的两个不同位置的字母,使得它和字符串 <code>Y</code> 相等,那么称 <code>X</code> 和 <code>Y</code> 两个字符串相似。如果这两个字符串本身是相等的,那它们也是相似的。</p>\n\n<p>例如,<code>"tars"</code> 和 <code>"rats"</code> 是相似的 (交换 <code>0</code> 与 <code>2</code> 的位置); <code>"rats"</code> 和 <code>"arts"</code> 也是相似的,但是 <code>"star"</code> 不与 <code>"tars"</code>,<code>"rats"</code>,或 <code>"arts"</code> 相似。</p>\n\n<p>总之,它们通过相似性形成了两个关联组:<code>{"tars", "rats", "arts"}</code> 和 <code>{"star"}</code>。注意,<code>"tars"</code> 和 <code>"arts"</code> 是在同一组中,即使它们并不相似。形式上,对每个组而言,要确定一个单词在组中,只需要这个词和该组中至少一个单词相似。</p>\n\n<p>给定一个字符串列表 <code>strs</code>。列表中的每个字符串都是 <code>strs</code> 中其它所有字符串的一个 <strong>字母异位词 </strong>。请问 <code>strs</code> 中有多少个相似字符串组?</p>\n\n<p><strong>字母异位词(anagram)</strong>,一种把某个字符串的字母的位置(顺序)加以改换所形成的新词。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>strs = ["tars","rats","arts","star"]\n<strong>输出:</strong>2\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>strs = ["omv","ovm"]\n<strong>输出:</strong>1\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= strs.length <= 300</code></li>\n\t<li><code>1 <= strs[i].length <= 300</code></li>\n\t<li><code>strs[i]</code> 只包含小写字母。</li>\n\t<li><code>strs</code> 中的所有单词都具有相同的长度,且是彼此的字母异位词。</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 839 题相同:<a href=\"https://leetcode-cn.com/problems/similar-string-groups/\">https://leetcode-cn.com/problems/similar-string-groups/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 9,
|
||||
"likes": 10,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -44,6 +44,12 @@
|
||||
"translatedName": "并查集",
|
||||
"__typename": "TopicTagNode"
|
||||
},
|
||||
{
|
||||
"name": "Array",
|
||||
"slug": "array",
|
||||
"translatedName": "数组",
|
||||
"__typename": "TopicTagNode"
|
||||
},
|
||||
{
|
||||
"name": "String",
|
||||
"slug": "string",
|
||||
@@ -162,7 +168,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"2.9K\", \"totalSubmission\": \"4.6K\", \"totalAcceptedRaw\": 2911, \"totalSubmissionRaw\": 4595, \"acRate\": \"63.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"3.5K\", \"totalSubmission\": \"5.6K\", \"totalAcceptedRaw\": 3544, \"totalSubmissionRaw\": 5641, \"acRate\": \"62.8%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user