In this paper we consider the numerical computation of the optimal costfunction associated to the problem that consists in finding the minimum ofthe maximum of a scalar functional on a trajectory. We present anapproximation method for the numerical solution which employs bothdiscretization on time and on spatial variables. In this way, we obtain afully discrete problem that has unique solution. We give an optimal estimatefor the error between the approximated solution and the optimal costfunction of the original problem. Also, numerical examples are presented.