1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-12 02:41:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

存量题库数据更新

This commit is contained in:
2023-12-09 18:42:21 +08:00
parent a788808cd7
commit c198538f10
10843 changed files with 288489 additions and 248355 deletions

View File

@@ -1,34 +1,37 @@
<p>出数字&nbsp;<code>N</code>,返回由若干&nbsp;<code>&quot;0&quot;</code>&nbsp;&nbsp;<code>&quot;1&quot;</code>组成的字符串,该字符串为 <code>N</code>&nbsp;<strong>负二进制(<code>base -2</code></strong>表示。</p>
<p>你一个整数 <code>n</code> ,以二进制字符串的形式返回该整数的 <strong>负二进制(<code>base -2</code></strong>表示。</p>
<p>除非字符串就是&nbsp;<code>&quot;0&quot;</code>,否则返回的字符串中不能含有前导零。</p>
<p><strong>注意,</strong>除非字符串就是&nbsp;<code>"0"</code>,否则返回的字符串中不能含有前导零。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre><strong>输入:</strong>2
<strong></strong>&quot;110&quot;
<strong>解释</strong>(-2) ^ 2 + (-2) ^ 1 = 2
<pre>
<strong></strong>n = 2
<strong>输出</strong>"110"
<strong>解释:</strong>(-2)<sup>2</sup> + (-2)<sup>1</sup> = 2
</pre>
<p><strong>示例 2</strong></p>
<pre><strong>输入:</strong>3
<strong></strong>&quot;111&quot;
<strong>解释</strong>(-2) ^ 2 + (-2) ^ 1 + (-2) ^ 0 = 3
<pre>
<strong></strong>n = 3
<strong>输出</strong>"111"
<strong>解释:</strong>(-2)<sup>2</sup> + (-2)<sup>1</sup> + (-2)<sup>0</sup> = 3
</pre>
<p><strong>示例 3</strong></p>
<pre><strong>输入:</strong>4
<strong></strong>&quot;100&quot;
<strong>解释</strong>(-2) ^ 2 = 4
<pre>
<strong></strong>n = 4
<strong>输出</strong>"100"
<strong>解释:</strong>(-2)<sup>2</sup> = 4
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ol>
<li><code>0 &lt;= N &lt;= 10^9</code></li>
</ol>
<ul>
<li><code>0 &lt;= n &lt;= 10<sup>9</sup></code></li>
</ul>