Answer:
The equation for the maximun height is given by the parametric equation of parabola

Explanation:
We have that

with

getting the general equation

For sure if the tangent of theta is less than h/d the ball doesn´t pass through the wall, this because we have the following trigonometric relation

so if the tangent of theta is less than that fraction the ball won´t clear the wall.
Finally for those data we have:}
