A spring with a constant of 2/5 (kg)/s^2 is lying on the ground with one end attached to a wall. An object with a mass of 1 kg and speed of 2 m/s collides with and compresses the spring until it stops moving. How much will the spring compress?

$x = 2 \sqrt{\frac{5}{2}}$[m]
The moving object has a kinetic energy given by ${E}_{c} = \frac{1}{2} m {v}^{2}$
All this energy is absorbed by the spring as potential energy as ${E}_{p} = \frac{1}{2} K {x}^{2}$. Equating the energies
$\frac{1}{2} m {v}^{2} = \frac{1}{2} K {x}^{2}$
and solving regarding $x$ gives
$x = v \sqrt{\frac{m}{K}} = 2 \sqrt{\frac{5}{2}}$[m]