1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/重新排序得到 2 的幂 [reordered-power-of-2].html

31 lines
662 B
HTML
Raw Normal View History

2022-03-27 20:46:41 +08:00
<p>给定正整数&nbsp;<code>n</code>&nbsp;,我们按任何顺序(包括原始顺序)将数字重新排序,注意其前导数字不能为零。</p>
<p>如果我们可以通过上述方式得到&nbsp;2 的幂,返回 <code>true</code>;否则,返回 <code>false</code></p>
<p>&nbsp;</p>
<ol>
</ol>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>n = 1
<strong>输出:</strong>true
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>n = 10
<strong>输出:</strong>false
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= n &lt;= 10<sup>9</sup></code></li>
</ul>