mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 07:21:40 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>设计一个方法,找出任意指定单词在一本书中的出现频率。</p>\n\n<p>你的实现应该支持如下操作:</p>\n\n<ul>\n\t<li><code>WordsFrequency(book)</code>构造函数,参数为字符串数组构成的一本书</li>\n\t<li><code>get(word)</code>查询指定单词在书中出现的频率</li>\n</ul>\n\n<p><strong>示例:</strong></p>\n\n<pre>WordsFrequency wordsFrequency = new WordsFrequency({"i", "have", "an", "apple", "he", "have", "a", "pen"});\nwordsFrequency.get("you"); //返回0,"you"没有出现过\nwordsFrequency.get("have"); //返回2,"have"出现2次\nwordsFrequency.get("an"); //返回1\nwordsFrequency.get("apple"); //返回1\nwordsFrequency.get("pen"); //返回1\n</pre>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>book[i]</code>中只包含小写字母</li>\n\t<li><code>1 <= book.length <= 100000</code></li>\n\t<li><code>1 <= book[i].length <= 10</code></li>\n\t<li><code>get</code>函数的调用次数不会超过100000</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 31,
|
||||
"likes": 34,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -161,7 +161,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"18K\", \"totalSubmission\": \"23.4K\", \"totalAcceptedRaw\": 18007, \"totalSubmissionRaw\": 23438, \"acRate\": \"76.8%\"}",
|
||||
"stats": "{\"totalAccepted\": \"18.5K\", \"totalSubmission\": \"24.1K\", \"totalAcceptedRaw\": 18505, \"totalSubmissionRaw\": 24109, \"acRate\": \"76.8%\"}",
|
||||
"hints": [
|
||||
"想想这个问题的最佳运行时间是多少。如果你的解法匹配最理想的运行时间,那么你可能无法做的更好了。",
|
||||
"可以使用散列表来优化重复的情况吗?"
|
||||
|
Reference in New Issue
Block a user