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)/和为零的N个唯一整数 [find-n-unique-integers-sum-up-to-zero].html
2022-03-29 12:43:11 +08:00

31 lines
809 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给你一个整数&nbsp;<code>n</code>,请你返回 <strong>任意&nbsp;</strong>一个由 <code>n</code>&nbsp;<strong>各不相同&nbsp;</strong>的整数组成的数组,并且这 <code>n</code> 个数相加和为 <code>0</code></p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre><strong>输入:</strong>n = 5
<strong>输出:</strong>[-7,-1,1,3,4]
<strong>解释:</strong>这些数组也是正确的 [-5,-1,1,2,3][-3,-1,2,-2,4]。
</pre>
<p><strong>示例 2</strong></p>
<pre><strong>输入:</strong>n = 3
<strong>输出:</strong>[-1,0,1]
</pre>
<p><strong>示例 3</strong></p>
<pre><strong>输入:</strong>n = 1
<strong>输出:</strong>[0]
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= n &lt;= 1000</code></li>
</ul>