package leetcode;

/**
 * https://leetcode.com/problems/count-triplets-that-can-form-two-arrays-of-equal-xor/
 */
public class Problem1442 {
    public int countTriplets(int[] arr) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1442 prob = new Problem1442();
        System.out.println(prob.countTriplets(new int[]{2,3,1,6,7})); // 4
        System.out.println(prob.countTriplets(new int[]{1,1,1,1,1})); // 10
        System.out.println(prob.countTriplets(new int[]{2,3})); // 0
        System.out.println(prob.countTriplets(new int[]{1,3,5,7,9})); // 3
        System.out.println(prob.countTriplets(new int[]{7,11,12,9,5,2,7,17,22})); // 8
    }
}

@@ -12,16 +12,42 @@
 tcode;%0A%0A
+import java.util.Arrays;%0A%0A
 /**%0A * h
@@ -214,32 +214,480 @@
     
-// TODO%0A        return 0
+int%5B%5D xor = new int%5Barr.length%5D;%0A        xor%5B0%5D = arr%5B0%5D;%0A        for (int i = 1; i %3C arr.length; i++) %7B%0A            xor%5Bi%5D = xor%5Bi - 1%5D %5E arr%5Bi%5D;%0A        %7D%0A        System.out.println(Arrays.toString(xor));%0A        int answer = 0;%0A        for (int i = 0; i %3C xor.length; i++) %7B%0A            for (int j = i + 1; j %3C xor.length; j++) %7B%0A                if ((xor%5Bi%5D %5E xor%5Bj%5D) == 0) %7B%0A                    answer++;%0A                %7D%0A            %7D%0A        %7D%0A        return answer
 ;%0A  
@@ -857,16 +857,18 @@
 ); // 4%0A
+//
         
@@ -935,16 +935,18 @@
 ; // 10%0A
+//
         
@@ -1006,16 +1006,18 @@
 ); // 0%0A
+//
         
@@ -1083,16 +1083,18 @@
 ); // 3%0A
+//
         

Update problem 1442