package leetcode;

/**
 * https://leetcode.com/problems/decode-xored-permutation/
 */
public class Problem1734 {
    public int[] decode(int[] encoded) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem1734 prob = new Problem1734();
        System.out.println(prob.decode(new int[]{3,1})); // [1,2,3]
        System.out.println(prob.decode(new int[]{6,5,4,6})); // [2,4,1,5,3]
    }
}

@@ -159,278 +159,394 @@
     
-// TODO%0A        return null;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem1734 prob = new Problem1734();%0A        System.out.println(prob.decode(new int%5B%5D%7B3,1%7D)); // %5B1,2,3%5D%0A        System.out.println(prob.decode(new int%5B%5D%7B6,5,4,6%7D)); // %5B2,4,1,5,3%5D
+int a = 0;%0A        int n = encoded.length + 1;%0A        for (int i = 0; i %3C= n; ++i) %7B%0A            a %5E= i;%0A            if (i %3C n && i %25 2 == 1) %7B%0A                a %5E= encoded%5Bi%5D;%0A            %7D%0A        %7D%0A        int%5B%5D answer = new int%5Bn%5D;%0A        answer%5B0%5D = a;%0A        for (int i = 0; i %3C n - 1; ++i) %7B%0A            answer%5Bi + 1%5D = answer%5Bi%5D %5E encoded%5Bi%5D;%0A        %7D%0A        return answer;
 %0A   

Solve problem 1734