package com.fishercoder.solutions;

/**
 * 1304. Find N Unique Integers Sum up to Zero
 *
 * Given an integer n, return any array containing n unique integers such that they add up to 0.
 *
 * 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]
 * */
public class _1304 {
    public static class Solution1 {
        public int[] sumZero(int n) {
            int[] result = new int[n];
            int start = -n / 2;
            for (int i = 0; i < n / 2; i++) {
                result[i] = start++;
            }
            if (n % 2 == 0) {
                start++;
            }
            for (int i = n / 2; i < n; i++) {
                result[i] = start++;
            }
            return result;
        }
    }
}

@@ -33,403 +33,8 @@
 s;%0A%0A
-/**%0A * 1304. Find N Unique Integers Sum up to Zero%0A *%0A * Given an integer n, return any array containing n unique integers such that they add up to 0.%0A *%0A * Example 1:%0A * Input: n = 5%0A * Output: %5B-7,-1,1,3,4%5D%0A * Explanation: These arrays also are accepted %5B-5,-1,1,2,3%5D , %5B-3,-1,2,-2,4%5D.%0A *%0A * Example 2:%0A * Input: n = 3%0A * Output: %5B-1,0,1%5D%0A *%0A * Example 3:%0A * Input: n = 1%0A * Output: %5B0%5D%0A * */%0A
 publ

refactor 1304