Solving Find N Unique Integers Sum up to Zero in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

Example 1:

Input: n = 5
Output: [-7,-1,1,3,4]
Explanation: These arrays also are accepted [-5,-1,1,2,3] , [-3,-1,2,-2,4].

Example 2:

Input: n = 3
Output: [-1,0,1]

Example 3:

Input: n = 1
Output: [0]

Constraints:

  • 1 <= n <= 1000

  • 1 <= n <= 1000

See the full details of the problem Find N Unique Integers Sum up to Zero at LeetCode

Originally posted at: @github.com/halfrost/LeetCode-Go