mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 23:41:41 +08:00
存量题库数据更新
This commit is contained in:
@@ -7,17 +7,17 @@
|
||||
"boundTopicId": 1312,
|
||||
"title": "Word Frequency",
|
||||
"titleSlug": "word-frequency",
|
||||
"content": "<p>Write a bash script to calculate the frequency of each word in a text file <code>words.txt</code>.</p>\r\n\r\n<p>For simplicity sake, you may assume:</p>\r\n\r\n<ul>\r\n\t<li><code>words.txt</code> contains only lowercase characters and space <code>' '</code> characters.</li>\r\n\t<li>Each word must consist of lowercase characters only.</li>\r\n\t<li>Words are separated by one or more whitespace characters.</li>\r\n</ul>\r\n\r\n<p><strong>Example:</strong></p>\r\n\r\n<p>Assume that <code>words.txt</code> has the following content:</p>\r\n\r\n<pre>\r\nthe day is sunny the the\r\nthe sunny is is\r\n</pre>\r\n\r\n<p>Your script should output the following, sorted by descending frequency:</p>\r\n\r\n<pre>\r\nthe 4\r\nis 3\r\nsunny 2\r\nday 1\r\n</pre>\r\n\r\n<p><b>Note:</b></p>\r\n\r\n<ul>\r\n\t<li>Don't worry about handling ties, it is guaranteed that each word's frequency count is unique.</li>\r\n\t<li>Could you write it in one-line using <a href=\"http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-4.html\">Unix pipes</a>?</li>\r\n</ul>\r\n",
|
||||
"content": "<p>Write a bash script to calculate the <span data-keyword=\"frequency-textfile\">frequency</span> of each word in a text file <code>words.txt</code>.</p>\n\n<p>For simplicity sake, you may assume:</p>\n\n<ul>\n\t<li><code>words.txt</code> contains only lowercase characters and space <code>' '</code> characters.</li>\n\t<li>Each word must consist of lowercase characters only.</li>\n\t<li>Words are separated by one or more whitespace characters.</li>\n</ul>\n\n<p><strong class=\"example\">Example:</strong></p>\n\n<p>Assume that <code>words.txt</code> has the following content:</p>\n\n<pre>\nthe day is sunny the the\nthe sunny is is\n</pre>\n\n<p>Your script should output the following, sorted by descending frequency:</p>\n\n<pre>\nthe 4\nis 3\nsunny 2\nday 1\n</pre>\n\n<p><b>Note:</b></p>\n\n<ul>\n\t<li>Don't worry about handling ties, it is guaranteed that each word's frequency count is unique.</li>\n\t<li>Could you write it in one-line using <a href=\"http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-4.html\">Unix pipes</a>?</li>\n</ul>\n",
|
||||
"translatedTitle": "统计词频",
|
||||
"translatedContent": "<p>写一个 bash 脚本以统计一个文本文件 <code>words.txt</code> 中每个单词出现的频率。</p>\n\n<p>为了简单起见,你可以假设:</p>\n\n<ul>\n\t<li><code>words.txt</code>只包括小写字母和 <code>' '</code> 。</li>\n\t<li>每个单词只由小写字母组成。</li>\n\t<li>单词间由一个或多个空格字符分隔。</li>\n</ul>\n\n<p><strong>示例:</strong></p>\n\n<p>假设 <code>words.txt</code> 内容如下:</p>\n\n<pre>the day is sunny the the\nthe sunny is is\n</pre>\n\n<p>你的脚本应当输出(以词频降序排列):</p>\n\n<pre>the 4\nis 3\nsunny 2\nday 1\n</pre>\n\n<p><strong>说明:</strong></p>\n\n<ul>\n\t<li>不要担心词频相同的单词的排序问题,每个单词出现的频率都是唯一的。</li>\n\t<li>你可以使用一行 <a href=\"http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-4.html\">Unix pipes</a> 实现吗?</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 186,
|
||||
"likes": 224,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Top K Frequent Elements\", \"titleSlug\": \"top-k-frequent-elements\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u524d K \\u4e2a\\u9ad8\\u9891\\u5143\\u7d20\"}]",
|
||||
"similarQuestions": "[{\"title\": \"Top K Frequent Elements\", \"titleSlug\": \"top-k-frequent-elements\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u524d K \\u4e2a\\u9ad8\\u9891\\u5143\\u7d20\", \"isPaidOnly\": false}]",
|
||||
"contributors": [],
|
||||
"langToValidPlayground": "{\"cpp\": false, \"java\": false, \"python\": false, \"python3\": false, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"ruby\": false, \"bash\": false, \"swift\": false, \"golang\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"kotlin\": false, \"rust\": false, \"php\": false, \"typescript\": false, \"racket\": false, \"erlang\": false, \"elixir\": false}",
|
||||
"langToValidPlayground": "{\"cpp\": false, \"java\": false, \"python\": false, \"python3\": false, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"typescript\": false, \"bash\": false, \"php\": false, \"swift\": false, \"kotlin\": false, \"dart\": false, \"golang\": false, \"ruby\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"rust\": false, \"racket\": false, \"erlang\": false, \"elixir\": false, \"pythondata\": false, \"react\": false, \"vanillajs\": false, \"postgresql\": false}",
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Shell",
|
||||
@@ -35,7 +35,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"25.3K\", \"totalSubmission\": \"70.5K\", \"totalAcceptedRaw\": 25257, \"totalSubmissionRaw\": 70513, \"acRate\": \"35.8%\"}",
|
||||
"stats": "{\"totalAccepted\": \"32.9K\", \"totalSubmission\": \"92.7K\", \"totalAcceptedRaw\": 32862, \"totalSubmissionRaw\": 92678, \"acRate\": \"35.5%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user