Computes the maximum value and returns the corresponding array indices.