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>给你一个整数数组 <code>nums</code> 。</p>\n\n<p>如果一组数字 <code>(i,j)</code> 满足 <code>nums[i]</code> == <code>nums[j]</code> 且 <code>i</code> < <code>j</code> ,就可以认为这是一组 <strong>好数对</strong> 。</p>\n\n<p>返回好数对的数目。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre><strong>输入:</strong>nums = [1,2,3,1,1,3]\n<strong>输出:</strong>4\n<strong>解释:</strong>有 4 组好数对,分别是 (0,3), (0,4), (3,4), (2,5) ,下标从 0 开始\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre><strong>输入:</strong>nums = [1,1,1,1]\n<strong>输出:</strong>6\n<strong>解释:</strong>数组中的每组数字都是好数对</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre><strong>输入:</strong>nums = [1,2,3]\n<strong>输出:</strong>0\n</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>1 <= nums[i] <= 100</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 83,
|
||||
"likes": 85,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -155,7 +155,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"63K\", \"totalSubmission\": \"74.2K\", \"totalAcceptedRaw\": 62976, \"totalSubmissionRaw\": 74192, \"acRate\": \"84.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"63.7K\", \"totalSubmission\": \"75.1K\", \"totalAcceptedRaw\": 63744, \"totalSubmissionRaw\": 75135, \"acRate\": \"84.8%\"}",
|
||||
"hints": [
|
||||
"Count how many times each number appears. If a number appears n times, then n * (n – 1) // 2 good pairs can be made with this number."
|
||||
],
|
||||
|
Reference in New Issue
Block a user