mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-25 23:08:57 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个整数数组 <code>nums</code> ,返回 <code>nums</code> 中所有 <strong>等差子序列</strong> 的数目。</p>\n\n<p>如果一个序列中 <strong>至少有三个元素</strong> ,并且任意两个相邻元素之差相同,则称该序列为等差序列。</p>\n\n<ul>\n\t<li>例如,<code>[1, 3, 5, 7, 9]</code>、<code>[7, 7, 7, 7]</code> 和 <code>[3, -1, -5, -9]</code> 都是等差序列。</li>\n\t<li>再例如,<code>[1, 1, 2, 5, 7]</code> 不是等差序列。</li>\n</ul>\n\n<p>数组中的子序列是从数组中删除一些元素(也可能不删除)得到的一个序列。</p>\n\n<ul>\n\t<li>例如,<code>[2,5,10]</code> 是 <code>[1,2,1,<em><strong>2</strong></em>,4,1,<strong><em>5</em></strong>,<em><strong>10</strong></em>]</code> 的一个子序列。</li>\n</ul>\n\n<p>题目数据保证答案是一个 <strong>32-bit</strong> 整数。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [2,4,6,8,10]\n<strong>输出:</strong>7\n<strong>解释:</strong>所有的等差子序列为:\n[2,4,6]\n[4,6,8]\n[6,8,10]\n[2,4,6,8]\n[4,6,8,10]\n[2,4,6,8,10]\n[2,6,10]\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [7,7,7,7,7]\n<strong>输出:</strong>16\n<strong>解释:</strong>数组中的任意子序列都是等差子序列。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= nums.length <= 1000</code></li>\n\t<li><code>-2<sup>31</sup> <= nums[i] <= 2<sup>31</sup> - 1</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 248,
|
||||
"likes": 251,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Arithmetic Slices\", \"titleSlug\": \"arithmetic-slices\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u7b49\\u5dee\\u6570\\u5217\\u5212\\u5206\"}]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"20.5K\", \"totalSubmission\": \"37.2K\", \"totalAcceptedRaw\": 20467, \"totalSubmissionRaw\": 37232, \"acRate\": \"55.0%\"}",
|
||||
"stats": "{\"totalAccepted\": \"20.7K\", \"totalSubmission\": \"37.7K\", \"totalAcceptedRaw\": 20713, \"totalSubmissionRaw\": 37657, \"acRate\": \"55.0%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
||||
Reference in New Issue
Block a user