mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-21 13:06:47 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个整数数组 <code>nums</code> ,请你将数组按照每个值的频率 <strong>升序</strong> 排序。如果有多个值的频率相同,请你按照数值本身将它们 <strong>降序</strong> 排序。 </p>\n\n<p>请你返回排序后的数组。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre><b>输入:</b>nums = [1,1,2,2,2,3]\n<b>输出:</b>[3,1,1,2,2,2]\n<b>解释:</b>'3' 频率为 1,'1' 频率为 2,'2' 频率为 3 。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre><b>输入:</b>nums = [2,3,1,3,2]\n<b>输出:</b>[1,3,3,2,2]\n<b>解释:</b>'2' 和 '3' 频率都为 2 ,所以它们之间按照数值本身降序排序。\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre><b>输入:</b>nums = [-1,1,-6,4,5,-6,1,4,1]\n<b>输出:</b>[5,-1,4,4,-6,-6,1,1,1]</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= nums.length <= 100</code></li>\n\t<li><code>-100 <= nums[i] <= 100</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 40,
|
||||
"likes": 43,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -149,7 +149,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"11.9K\", \"totalSubmission\": \"17.1K\", \"totalAcceptedRaw\": 11934, \"totalSubmissionRaw\": 17107, \"acRate\": \"69.8%\"}",
|
||||
"stats": "{\"totalAccepted\": \"12.4K\", \"totalSubmission\": \"17.7K\", \"totalAcceptedRaw\": 12396, \"totalSubmissionRaw\": 17748, \"acRate\": \"69.8%\"}",
|
||||
"hints": [
|
||||
"Count the frequency of each value.",
|
||||
"Use a custom comparator to compare values by their frequency. If two values have the same frequency, compare their values."
|
||||
|
Reference in New Issue
Block a user