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