code: public static void inverse(int[] a)
    {
      for (int i = 0; i < a.length; i++) {
        if (a[i] >= 0) {
          inverseLoop(a, i);
        }
      }
  
      for (int i = 0; i < a.length; i++) {
        a[i] = ~a[i];
      }
    }
docs: Inverses the values of the given array with their indexes.
  For example, the result for [2, 0, 1] is [1, 2, 0] because
  
  a[0]: 2 => a[2]: 0
  a[1]: 0 => a[0]: 1
  a[2]: 1 => a[1]: 2