Now that the problem has been marked "solved", I can contribute a quicker way to get to the answer. The required distance ##x_{min.}## will depend on two independent parameters, the constant speed ##v_0## of the trailing car and the maximum acceleration ##a## of the leading car. The leading car must reach speed ##v_0## over the minimum distance ##x_{min.}##. If it moves slower than that, it started accelerating too late; if it moves faster than that, it started accelerating too soon. Therefore, from the "fourth" kinematic equation $$2ax_{min.}=v_0^2 - 0^2 \rightarrow x_{min.}=\frac{v_0^2}{2a}$$