An ore car of mass 40000 kg starts from rest and rolls downhill on tracks from a mine. At the end of the tracks, 16 m lower vertically, is a horizontally situated spring with constant 2.7 × 105 N/m.

The acceleration of gravity is 9.8 m/s2 . Ignore friction.
How much is the spring compressed in stop- ping the ore car?
Answer in units of m.

MY ANSWER
Fs = Kx
x = K(Fs)
x = (2.7*10^5 N/m)(40,000 kg * 9.8m/s^2)

where
Vinitial = 0m/s
d = 16m
k = 2.7*10^5 N/m
a = 9.8m/s^2
No friction.
x = ? meters

1 answer

I think they're hinting at energy:
mgh = 1/2 k x^2