(b) To leave the block, it oscillates in vertical plane. If maximum extension in spring in extreme position of block is $x_{1}$ , then
Work done by weight of the block
=Potential energy stored in spring
$mg\ x = \frac{1}{2}kx^{2}$
$\therefore x = 2\frac{mg}{k}\ 2d\ \ \ \ \ \ \ \ \ \ \ \ \ \ \left( \because d = \frac{mg}{k} \right)\ \ \ $