package leetcode;

/**
 * https://leetcode.com/problems/bitwise-ors-of-subarrays/
 */
public class Problem898 {
    public int subarrayBitwiseORs(int[] A) {
        // TODO
        return 0;
    }

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

@@ -12,16 +12,65 @@
 tcode;%0A%0A
+import java.util.HashSet;%0Aimport java.util.Set;%0A%0A
 /**%0A * h
@@ -211,15 +211,305 @@
     
-// TODO
+Set%3CInteger%3E set = new HashSet%3C%3E();%0A        for (int i = 0; i %3C A.length; i++) %7B%0A            int or = A%5Bi%5D;%0A            set.add(or);%0A            for (int j = i + 1; j %3C A.length; j++) %7B%0A                set.add(A%5Bj%5D);%0A                or %7C= A%5Bj%5D;%0A                set.add(or);%0A            %7D%0A        %7D
 %0A   
@@ -520,17 +520,26 @@
  return 
-0
+set.size()
 ;%0A    %7D%0A

Update problem 898