code: public static void unitize1(double[] x) {
          double n = norm1(x);
  
          for (int i = 0; i < x.length; i++) {
              x[i] /= n;
          }
      }
docs: Unitize an array so that L1 norm of x is 1.
  
  @param x an array of nonnegative double