1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-03 06:22:54 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>给你一个整数数组&nbsp;<code>arr</code>,请你检查是否存在两个整数&nbsp;<code>N</code> 和 <code>M</code>,满足&nbsp;<code>N</code>&nbsp;是&nbsp;<code>M</code>&nbsp;的两倍(即,<code>N = 2 * M</code>)。</p>\n\n<p>更正式地,检查是否存在两个下标&nbsp;<code>i</code> 和 <code>j</code> 满足:</p>\n\n<ul>\n\t<li><code>i != j</code></li>\n\t<li><code>0 &lt;= i, j &lt; arr.length</code></li>\n\t<li><code>arr[i] == 2 * arr[j]</code></li>\n</ul>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre><strong>输入:</strong>arr = [10,2,5,3]\n<strong>输出:</strong>true\n<strong>解释:</strong>N<code> = 10</code> 是 M<code> = 5 的两倍</code>,即 <code>10 = 2 * 5 。</code>\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre><strong>输入:</strong>arr = [7,1,14,11]\n<strong>输出:</strong>true\n<strong>解释:</strong>N<code> = 14</code> 是 M<code> = 7 的两倍</code>,即 <code>14 = 2 * 7 </code>。\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre><strong>输入:</strong>arr = [3,1,7,11]\n<strong>输出:</strong>false\n<strong>解释:</strong>在该情况下不存在 N 和 M 满足 N = 2 * M 。\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>2 &lt;= arr.length &lt;= 500</code></li>\n\t<li><code>-10^3 &lt;= arr[i] &lt;= 10^3</code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 48,
"likes": 52,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -161,7 +161,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"18.5K\", \"totalSubmission\": \"43.1K\", \"totalAcceptedRaw\": 18539, \"totalSubmissionRaw\": 43130, \"acRate\": \"43.0%\"}",
"stats": "{\"totalAccepted\": \"20.5K\", \"totalSubmission\": \"47.7K\", \"totalAcceptedRaw\": 20538, \"totalSubmissionRaw\": 47675, \"acRate\": \"43.1%\"}",
"hints": [
"Loop from i = 0 to arr.length, maintaining in a hashTable the array elements from [0, i - 1].",
"On each step of the loop check if we have seen the element 2 * arr[i] so far or arr[i] / 2 was seen if arr[i] % 2 == 0."