mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 23:41:41 +08:00
存量题库数据更新
This commit is contained in:
@@ -6,13 +6,13 @@
|
||||
"boundTopicId": null,
|
||||
"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": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 363,
|
||||
"dislikes": 240,
|
||||
"likes": 521,
|
||||
"dislikes": 303,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Top K Frequent Elements\", \"titleSlug\": \"top-k-frequent-elements\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
|
||||
"exampleTestcases": "a",
|
||||
@@ -35,7 +35,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"37K\", \"totalSubmission\": \"144.5K\", \"totalAcceptedRaw\": 36968, \"totalSubmissionRaw\": 144480, \"acRate\": \"25.6%\"}",
|
||||
"stats": "{\"totalAccepted\": \"47.1K\", \"totalSubmission\": \"185.1K\", \"totalAcceptedRaw\": 47079, \"totalSubmissionRaw\": 185107, \"acRate\": \"25.4%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user