1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-21 13:06:47 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-03-29 16:56:27 +08:00
parent e730aa6794
commit ad15da05aa
2517 changed files with 7358 additions and 7332 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>一个整数数组&nbsp;<code>original</code>&nbsp;可以转变成一个 <strong>双倍</strong>&nbsp;数组&nbsp;<code>changed</code>&nbsp;,转变方式为将 <code>original</code>&nbsp;中每个元素 <strong>值乘以 2 </strong>加入数组中,然后将所有元素 <strong>随机打乱</strong>&nbsp;。</p>\n\n<p>给你一个数组&nbsp;<code>changed</code>&nbsp;,如果&nbsp;<code>change</code>&nbsp;是&nbsp;<strong>双倍</strong>&nbsp;数组,那么请你返回&nbsp;<code>original</code>数组,否则请返回空数组。<code>original</code>&nbsp;的元素可以以&nbsp;<strong>任意</strong>&nbsp;顺序返回。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre><b>输入:</b>changed = [1,3,4,2,6,8]\n<b>输出:</b>[1,3,4]\n<b>解释:</b>一个可能的 original 数组为 [1,3,4] :\n- 将 1 乘以 2 ,得到 1 * 2 = 2 。\n- 将 3 乘以 2 ,得到 3 * 2 = 6 。\n- 将 4 乘以 2 ,得到 4 * 2 = 8 。\n其他可能的原数组方案为 [4,3,1] 或者 [3,1,4] 。\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre><b>输入:</b>changed = [6,3,0,1]\n<b>输出:</b>[]\n<b>解释:</b>changed 不是一个双倍数组。\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre><b>输入:</b>changed = [1]\n<b>输出:</b>[]\n<b>解释:</b>changed 不是一个双倍数组。\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= changed.length &lt;= 10<sup>5</sup></code></li>\n\t<li><code>0 &lt;= changed[i] &lt;= 10<sup>5</sup></code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 18,
"likes": 19,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -155,7 +155,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"4.4K\", \"totalSubmission\": \"13.7K\", \"totalAcceptedRaw\": 4441, \"totalSubmissionRaw\": 13704, \"acRate\": \"32.4%\"}",
"stats": "{\"totalAccepted\": \"4.5K\", \"totalSubmission\": \"13.8K\", \"totalAcceptedRaw\": 4455, \"totalSubmissionRaw\": 13750, \"acRate\": \"32.4%\"}",
"hints": [
"If changed is a doubled array, you should be able to delete elements and their doubled values until the array is empty.",
"Which element is guaranteed to not be a doubled value? It is the smallest element.",