mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-02 22:13:28 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>设计一个使用单词列表进行初始化的数据结构,单词列表中的单词 <strong>互不相同</strong> 。 如果给出一个单词,请判定能否只将这个单词中<strong>一个</strong>字母换成另一个字母,使得所形成的新单词存在于已构建的神奇字典中。</p>\n\n<p>实现 <code>MagicDictionary</code> 类:</p>\n\n<ul>\n\t<li><code>MagicDictionary()</code> 初始化对象</li>\n\t<li><code>void buildDict(String[] dictionary)</code> 使用字符串数组 <code>dictionary</code> 设定该数据结构,<code>dictionary</code> 中的字符串互不相同</li>\n\t<li><code>bool search(String searchWord)</code> 给定一个字符串 <code>searchWord</code> ,判定能否只将字符串中<strong> 一个 </strong>字母换成另一个字母,使得所形成的新字符串能够与字典中的任一字符串匹配。如果可以,返回 <code>true</code> ;否则,返回 <code>false</code> 。</li>\n</ul>\n\n<p> </p>\n\n<div class=\"top-view__1vxA\">\n<div class=\"original__bRMd\">\n<div>\n<p><strong>示例:</strong></p>\n\n<pre>\n<strong>输入</strong>\ninputs = ["MagicDictionary", "buildDict", "search", "search", "search", "search"]\ninputs = [[], [["hello", "leetcode"]], ["hello"], ["hhllo"], ["hell"], ["leetcoded"]]\n<strong>输出</strong>\n[null, null, false, true, false, false]\n\n<strong>解释</strong>\nMagicDictionary magicDictionary = new MagicDictionary();\nmagicDictionary.buildDict(["hello", "leetcode"]);\nmagicDictionary.search("hello"); // 返回 False\nmagicDictionary.search("hhllo"); // 将第二个 'h' 替换为 'e' 可以匹配 "hello" ,所以返回 True\nmagicDictionary.search("hell"); // 返回 False\nmagicDictionary.search("leetcoded"); // 返回 False\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= dictionary.length <= 100</code></li>\n\t<li><code>1 <= dictionary[i].length <= 100</code></li>\n\t<li><code>dictionary[i]</code> 仅由小写英文字母组成</li>\n\t<li><code>dictionary</code> 中的所有字符串 <strong>互不相同</strong></li>\n\t<li><code>1 <= searchWord.length <= 100</code></li>\n\t<li><code>searchWord</code> 仅由小写英文字母组成</li>\n\t<li><code>buildDict</code> 仅在 <code>search</code> 之前调用一次</li>\n\t<li>最多调用 <code>100</code> 次 <code>search</code></li>\n</ul>\n</div>\n</div>\n</div>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 676 题相同: <a href=\"https://leetcode-cn.com/problems/implement-magic-dictionary/\">https://leetcode-cn.com/problems/implement-magic-dictionary/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 17,
|
||||
"likes": 19,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -162,7 +162,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"5.2K\", \"totalSubmission\": \"8.4K\", \"totalAcceptedRaw\": 5168, \"totalSubmissionRaw\": 8408, \"acRate\": \"61.5%\"}",
|
||||
"stats": "{\"totalAccepted\": \"6.3K\", \"totalSubmission\": \"10.3K\", \"totalAcceptedRaw\": 6322, \"totalSubmissionRaw\": 10316, \"acRate\": \"61.3%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user