mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-25 14:58:56 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个字符串 <code>licensePlate</code> 和一个字符串数组 <code>words</code> ,请你找出 <code>words</code> 中的 <strong>最短补全词</strong> 。</p>\n\n<p><strong>补全词 </strong>是一个包含 <code>licensePlate</code> 中所有字母的单词。<strong>忽略</strong> <code>licensePlate</code> 中的 <strong>数字和空格 </strong>。<strong>不区分大小写</strong>。如果某个字母在 <code>licensePlate</code> 中出现不止一次,那么该字母在补全词中的出现次数应当一致或者更多。</p>\n\n<p>例如:<code>licensePlate</code><code> = \"aBc 12c\"</code>,那么它的补全词应当包含字母 <code>'a'</code>、<code>'b'</code> (忽略大写)和两个 <code>'c'</code> 。可能的 <strong>补全词</strong> 有 <code>\"abccdef\"</code>、<code>\"caaacab\"</code> 以及 <code>\"cbca\"</code> 。</p>\n\n<p>请返回 <code>words</code> 中的 <strong>最短补全词</strong> 。题目数据保证一定存在一个最短补全词。当有多个单词都符合最短补全词的匹配条件时取 <code>words</code> 中 <strong>第一个</strong> 出现的那个。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>licensePlate = \"1s3 PSt\", words = [\"step\", \"steps\", \"stripe\", \"stepple\"]\n<strong>输出:</strong>\"steps\"\n<strong>解释:</strong>最短补全词应该包括 \"s\"、\"p\"、\"s\"(忽略大小写) 以及 \"t\"。\n\"step\" 包含 \"t\"、\"p\",但只包含一个 \"s\",所以它不符合条件。\n\"steps\" 包含 \"t\"、\"p\" 和两个 \"s\"。\n\"stripe\" 缺一个 \"s\"。\n\"stepple\" 缺一个 \"s\"。\n因此,\"steps\" 是唯一一个包含所有字母的单词,也是本例的答案。</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>licensePlate = \"1s3 456\", words = [\"looks\", \"pest\", \"stew\", \"show\"]\n<strong>输出:</strong>\"pest\"\n<strong>解释:</strong>licensePlate 只包含字母 \"s\" 。所有的单词都包含字母 \"s\" ,其中 \"pest\"、\"stew\"、和 \"show\" 三者最短。答案是 \"pest\" ,因为它是三个单词中在 words 里最靠前的那个。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= licensePlate.length <= 7</code></li>\n\t<li><code>licensePlate</code> 由数字、大小写字母或空格 <code>' '</code> 组成</li>\n\t<li><code>1 <= words.length <= 1000</code></li>\n\t<li><code>1 <= words[i].length <= 15</code></li>\n\t<li><code>words[i]</code> 由小写英文字母组成</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 115,
|
||||
"likes": 116,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -149,7 +149,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"40.6K\", \"totalSubmission\": \"59.7K\", \"totalAcceptedRaw\": 40557, \"totalSubmissionRaw\": 59700, \"acRate\": \"67.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"41.1K\", \"totalSubmission\": \"60.6K\", \"totalAcceptedRaw\": 41125, \"totalSubmissionRaw\": 60622, \"acRate\": \"67.8%\"}",
|
||||
"hints": [
|
||||
"Count only the letters (possibly converted to lowercase) of each word. If a word is shorter and the count of each letter is at least the count of that letter in the licensePlate, it is the best answer we've seen yet."
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user