Solution :
It is given that a system is released from rest where no slack is attached to the cable and the spring is unstretched.
Mass of the cart = 30 kg
Applying the conservation of energy of the system,
Loss of the gravitational potential energy (PE) = the energy stored in the spring.
i.e.,
x = 1.98
Therefore the distance travelled by the 30 kg cart is 1.98 m.