code: public static int unionSize(long[] x, long[] y) {
      final int lx = x.length, ly = y.length;
      final int min = (lx < ly) ? lx : ly;
      int i = 0, res = 0;
      for(; i < min; i++) {
        res += Long.bitCount(x[i] | y[i]);
      }
      for(; i < lx; i++) {
        res += Long.bitCount(x[i]);
      }
      for(; i < ly; i++) {
        res += Long.bitCount(y[i]);
      }
      return res;
    }
docs: Compute the union size of two Bitsets.
  
  @param x First bitset
  @param y Second bitset
  @return Union size