mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-07 08:21:41 +08:00
update
This commit is contained in:
@@ -7,12 +7,12 @@
|
||||
"boundTopicId": 94601,
|
||||
"title": "Find Closest LCCI",
|
||||
"titleSlug": "find-closest-lcci",
|
||||
"content": "<p>You have a large text file containing words. Given any two words, find the shortest distance (in terms of number of words) between them in the file. If the operation will be repeated many times for the same file (but different pairs of words), can you optimize your solution?</p>\r\n\r\n<p><strong>Example: </strong></p>\r\n\r\n<pre>\r\n<strong>Input: </strong>words = ["I","am","a","student","from","a","university","in","a","city"], word1 = "a", word2 = "student"\r\n<strong>Output: </strong>1</pre>\r\n\r\n<p>Note:</p>\r\n\r\n<ul>\r\n\t<li><code>words.length <= 100000</code></li>\r\n</ul>\r\n",
|
||||
"content": "<p>You have a large text file containing words. Given any two different words, find the shortest distance (in terms of number of words) between them in the file. If the operation will be repeated many times for the same file (but different pairs of words), can you optimize your solution?</p>\r\n\r\n<p><strong>Example: </strong></p>\r\n\r\n<pre>\r\n<strong>Input: </strong>words = ["I","am","a","student","from","a","university","in","a","city"], word1 = "a", word2 = "student"\r\n<strong>Output: </strong>1</pre>\r\n\r\n<p>Note:</p>\r\n\r\n<ul>\r\n\t<li><code>words.length <= 100000</code></li>\r\n</ul>",
|
||||
"translatedTitle": "单词距离",
|
||||
"translatedContent": "<p>有个内含单词的超大文本文件,给定任意两个单词,找出在这个文件中这两个单词的最短距离(相隔单词数)。如果寻找过程在这个文件中会重复多次,而每次寻找的单词不同,你能对此优化吗?</p>\n\n<p><strong>示例:</strong></p>\n\n<pre><strong>输入:</strong>words = ["I","am","a","student","from","a","university","in","a","city"], word1 = "a", word2 = "student"\n<strong>输出:</strong>1</pre>\n\n<p>提示:</p>\n\n<ul>\n\t<li><code>words.length <= 100000</code></li>\n</ul>\n",
|
||||
"translatedContent": "<p>有个内含单词的超大文本文件,给定任意两个<code>不同的</code>单词,找出在这个文件中这两个单词的最短距离(相隔单词数)。如果寻找过程在这个文件中会重复多次,而每次寻找的单词不同,你能对此优化吗?</p>\n\n<p><strong>示例:</strong></p>\n\n<pre>\n<strong>输入:</strong>words = [\"I\",\"am\",\"a\",\"student\",\"from\",\"a\",\"university\",\"in\",\"a\",\"city\"], word1 = \"a\", word2 = \"student\"\n<strong>输出:</strong>1</pre>\n\n<p>提示:</p>\n\n<ul>\n\t<li><code>words.length <= 100000</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 35,
|
||||
"likes": 36,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"16.4K\", \"totalSubmission\": \"24K\", \"totalAcceptedRaw\": 16429, \"totalSubmissionRaw\": 24027, \"acRate\": \"68.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"16.8K\", \"totalSubmission\": \"24.6K\", \"totalAcceptedRaw\": 16823, \"totalSubmissionRaw\": 24563, \"acRate\": \"68.5%\"}",
|
||||
"hints": [
|
||||
"如果只运行一次算法,请首先考虑寻找最近距离的算法。你应该能够在 O(N) 时间内完成这项工作,其中 N 是文档中的字数。",
|
||||
"调整你的算法,使它成为可以重复调用的算法的一次执行。它哪里慢?你能优化它吗?",
|
||||
|
Reference in New Issue
Block a user