Since the ball is thrown upwards and it reaches back,
so time to reach maximum height is half of total time i.e.,
$t_{\text {maximum }}=2 \,\sec$
Also speed at maximum height is zero, so
$o=u-g t_{\max } $
$\Rightarrow u=g t_{\max }=20\, ms ^{-1} $
$\left(\because g=10 \,ms ^{-2}\right)$