(b) Let $A\ $and $B$ will meet after time $t\ sec$. it means the distance travelled by both will be equal
$S_{A} = ut = 40t$ and $S_{B} = \frac{1}{2}at^{2} = \frac{1}{2} \times 4 \times t^{2}$
$S_{A} = S_{B} \Rightarrow 40t = \frac{1}{2}4t^{2} \Rightarrow t = 20\ sec$