mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-11 02:58:13 +08:00
36 lines
1.0 KiB
HTML
36 lines
1.0 KiB
HTML
<p>给定一个长度为偶数的整数数组 <code>arr</code>,只有对 <code>arr</code> 进行重组后可以满足 “对于每个 <code>0 <= i < len(arr) / 2</code>,都有 <code>arr[2 * i + 1] = 2 * arr[2 * i]</code>” 时,返回 <code>true</code>;否则,返回 <code>false</code>。</p>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>示例 1:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>arr = [3,1,3,6]
|
||
<strong>输出:</strong>false
|
||
</pre>
|
||
|
||
<p><strong>示例 2:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>arr = [2,1,2,6]
|
||
<strong>输出:</strong>false
|
||
</pre>
|
||
|
||
<p><strong>示例 3:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>arr = [4,-2,2,-4]
|
||
<strong>输出:</strong>true
|
||
<strong>解释:</strong>可以用 [-2,-4] 和 [2,4] 这两组组成 [-2,-4,2,4] 或是 [2,4,-2,-4]
|
||
</pre>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>提示:</strong></p>
|
||
|
||
<ul>
|
||
<li><code>0 <= arr.length <= 3 * 10<sup>4</sup></code></li>
|
||
<li><code>arr.length</code> 是偶数</li>
|
||
<li><code>-10<sup>5</sup> <= arr[i] <= 10<sup>5</sup></code></li>
|
||
</ul>
|