Although the approach suggested by INDIAN_ ARMY is perfect.
Here is the complete solution,
Impulse = Change in momentum
Or, F.dt = Final momentum - Initial momentum
Or, F.dt = P2 - P1 ....(1)
Where F is the average force.
Here when the spring is compressed by x0, then block of mass 2m is at rest.
Thus, P1 = 0
Also P2 = 2m.v ...(2)
Here, Using
change in kinetic energy = change in potential energy
Or, (1/2)(2m) v2 = (1/2)kx02
Or, v = x0.(k/2m)1/2 ....(3)
From (1), (2) and (3)
F.dt = 2mx0.(k/2m)1/2
Or F = (2mk)1/2 x0 / dt