(N/A) Let the spring constant be $k$. When the mass $M$ is displaced downwards by a distance $x$,the pulley moves down by $x$. Since the string is inextensible and passes over the pulley,both sides of the string attached to the pulley must move down by $x$. This causes the spring to stretch by an additional $2x$.
The change in the spring force is $\Delta F = k(2x) = 2kx$.
Since the string is connected to the pulley on both sides,the restoring force $F_{rest}$ acting on the mass $M$ is the sum of the tension changes on both sides of the pulley. Each side of the string experiences a tension change of $\Delta T = k(2x) = 2kx$.
Therefore,the total restoring force is $F_{rest} = 2 \times \Delta T = 2 \times (2kx) = 4kx$.
Comparing this with the standard $SHM$ restoring force equation $F = -k_{eff}x$,we get the effective spring constant $k_{eff} = 4k$.
The time period $T$ of the system is given by $T = 2\pi \sqrt{\frac{M}{k_{eff}}} = 2\pi \sqrt{\frac{M}{4k}} = \pi \sqrt{\frac{M}{k}}$.