|
| 1 | +<h2><a href="https://leetcode.com/problems/find-n-unique-integers-sum-up-to-zero">Find N Unique Integers Sum up to Zero</a></h2> <img src='https://img.shields.io/badge/Difficulty-Easy-brightgreen' alt='Difficulty: Easy' /><hr><p>Given an integer <code>n</code>, return <strong>any</strong> array containing <code>n</code> <strong>unique</strong> integers such that they add up to <code>0</code>.</p> |
| 2 | + |
| 3 | +<p> </p> |
| 4 | +<p><strong class="example">Example 1:</strong></p> |
| 5 | + |
| 6 | +<pre> |
| 7 | +<strong>Input:</strong> n = 5 |
| 8 | +<strong>Output:</strong> [-7,-1,1,3,4] |
| 9 | +<strong>Explanation:</strong> These arrays also are accepted [-5,-1,1,2,3] , [-3,-1,2,-2,4]. |
| 10 | +</pre> |
| 11 | + |
| 12 | +<p><strong class="example">Example 2:</strong></p> |
| 13 | + |
| 14 | +<pre> |
| 15 | +<strong>Input:</strong> n = 3 |
| 16 | +<strong>Output:</strong> [-1,0,1] |
| 17 | +</pre> |
| 18 | + |
| 19 | +<p><strong class="example">Example 3:</strong></p> |
| 20 | + |
| 21 | +<pre> |
| 22 | +<strong>Input:</strong> n = 1 |
| 23 | +<strong>Output:</strong> [0] |
| 24 | +</pre> |
| 25 | + |
| 26 | +<p> </p> |
| 27 | +<p><strong>Constraints:</strong></p> |
| 28 | + |
| 29 | +<ul> |
| 30 | + <li><code>1 <= n <= 1000</code></li> |
| 31 | +</ul> |
0 commit comments