Time of flight $T = (2u \sin\theta)/g$ and maximum height $H = (u^2 \sin^2\theta)/(2g)$. This gives $T^2 = 8H/g$, so $T \propto \sqrt{H}$. The time of flight is largest when the maximum height is largest.