package leetcode;

/**
 * https://leetcode.com/problems/find-n-unique-integers-sum-up-to-zero
 */
public class Problem5295 {
    public int[] sumZero(int n) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem5295 prob = new Problem5295();
        System.out.println(prob.sumZero(5)); // [-7,-1,1,3,4]
        System.out.println(prob.sumZero(3)); // [-1,0,1]
        System.out.println(prob.sumZero(1)); // [0]
    }
}

@@ -164,305 +164,267 @@
     
-// TODO%0A        return null
+int%5B%5D answer = new int%5Bn%5D;%0A        int index = 0
 ;%0A    
-%7D%0A%0A
     
-public static void main(String%5B%5D args) %7B%0A        Problem5295 prob = new Problem5295();%0A        System.out.println(prob.sumZero(5)); // %5B-7,-1,1,3,4%5D%0A        System.out.println(prob.sumZero(3)); // %5B-1,0,1%5D%0A        System.out.println(prob.sumZero(1)); // %5B0%5D
+for (int i = 1; i %3C= n / 2; i++) %7B%0A            answer%5Bindex++%5D = i;%0A            answer%5Bindex++%5D = -i;%0A        %7D%0A        if (n %25 2 != 0) %7B%0A            answer%5Bindex%5D = 0;%0A        %7D%0A        return answer;
 %0A   

Solve problem 5295