docs: public static int countUnique(int[] indices1, int[] indices2) {
          int numUniqueIndices = 0;
          int i = 0;
          int j = 0;
          while (i < indices1.length && j < indices2.length) {
              if (indices1[i] < indices2[j]) {
                  numUniqueIndices++;
                  i++;
              } else if (indices2[j] < indices1[i]) {
                  numUniqueIndices++;
                  j++;
              } else {
                  // Equal indices.
                  i++;
                  j++;
              }
          }
          for (; i < indices1.length; i++) {
              numUniqueIndices++;
          }
          for (; j < indices2.length; j++) {
              numUniqueIndices++;
          }
          return numUniqueIndices;
      }