1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-02 22:13:28 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>现有一种使用英语字母的外星文语言,这门语言的字母顺序与英语顺序不同。</p>\n\n<p>给定一个字符串列表 <code>words</code> ,作为这门语言的词典,<code>words</code> 中的字符串已经 <strong>按这门新语言的字母顺序进行了排序</strong> 。</p>\n\n<p>请你根据该词典还原出此语言中已知的字母顺序,并 <strong>按字母递增顺序</strong> 排列。若不存在合法字母顺序,返回 <code>&quot;&quot;</code> 。若存在多种可能的合法字母顺序,返回其中 <strong>任意一种</strong> 顺序即可。</p>\n\n<p>字符串 <code>s</code> <strong>字典顺序小于</strong> 字符串 <code>t</code> 有两种情况:</p>\n\n<ul>\n\t<li>在第一个不同字母处,如果 <code>s</code> 中的字母在这门外星语言的字母顺序中位于 <code>t</code> 中字母之前,那么&nbsp;<code>s</code> 的字典顺序小于 <code>t</code> 。</li>\n\t<li>如果前面 <code>min(s.length, t.length)</code> 字母都相同,那么 <code>s.length &lt; t.length</code> 时,<code>s</code> 的字典顺序也小于 <code>t</code> 。</li>\n</ul>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>words = [&quot;wrt&quot;,&quot;wrf&quot;,&quot;er&quot;,&quot;ett&quot;,&quot;rftt&quot;]\n<strong>输出:</strong>&quot;wertf&quot;\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>words = [&quot;z&quot;,&quot;x&quot;]\n<strong>输出:</strong>&quot;zx&quot;\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<strong>输入:</strong>words = [&quot;z&quot;,&quot;x&quot;,&quot;z&quot;]\n<strong>输出:</strong>&quot;&quot;\n<strong>解释:</strong>不存在合法字母顺序,因此返回 <code>&quot;&quot; 。</code>\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= words.length &lt;= 100</code></li>\n\t<li><code>1 &lt;= words[i].length &lt;= 100</code></li>\n\t<li><code>words[i]</code> 仅由小写英文字母组成</li>\n</ul>\n\n<p>&nbsp;</p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 269&nbsp;题相同:&nbsp;<a href=\"https://leetcode-cn.com/problems/alien-dictionary/\">https://leetcode-cn.com/problems/alien-dictionary/</a></p>\n",
"isPaidOnly": false,
"difficulty": "Hard",
"likes": 12,
"likes": 17,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -174,7 +174,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"2.5K\", \"totalSubmission\": \"5.9K\", \"totalAcceptedRaw\": 2470, \"totalSubmissionRaw\": 5905, \"acRate\": \"41.8%\"}",
"stats": "{\"totalAccepted\": \"2.9K\", \"totalSubmission\": \"7K\", \"totalAcceptedRaw\": 2941, \"totalSubmissionRaw\": 6969, \"acRate\": \"42.2%\"}",
"hints": [],
"solution": null,
"status": null,