initially the spring is compressed by 3cm.. so initial PE = 104*(0.03)2/2 = 4.5 J
KE of the system after the block leaves the spring = 1.v2/2
Now, from conservation of energy .. KE gained = PE lost
==> v2 = 9
==> v = 3 m/s
Now .. time taken to reach the initial position where it left the spring = 2L/v = 2*0.04/3 = 0.0267 s
now.. for time taken for the block .. to stop. .. i.e. it will undergo SHM with amplitude 3cm.. at time period.. 2Ï€√1/104 s = Ï€/50 s
Now.... the time taken by block .. to leave the spring initially is equal to 1/4th of an oscillation and similarly... to reach the stopping point again is 1/4th of the oscillation ...
So. total time in oscillating = T/2 = π/100 s = 0.0314s
So total time taken = 0.0581 s