There are two angles of projection for which the horizontal range is same i.e. θ and 90o - θ.
Maximum height H1 for angle projection θ
H1 = (u sin θ)^2/ 2g
Maximum height H2 for angle projection θ
H2 = (u sin(90- θ))^2/ 2g = (u cos θ)^2/ 2g
Now, H1+H2 = (u sin θ)^2/ 2g + (u cos θ)^2/ 2g = u^2 / 2g.
Hence the result.