the friction if sliding is greater than rolling
So the acceleration of gravity is 9.8 m/s so that’s how quickly it will accelerate downwards. You can use a kinematic equation to determine your answer. We know that initial velocity was 19 m/s, final velocity must be 0 m/s because it’s at the very top, and the acceleration is -9.8 m/s. You can then use this equation:
Vf^2=Vo^2+2ax
Plugging in values:
361=19.6x
X=18 m
The initial kinetic energy of the cart is

(1)
where m is the mass of the cart and v its initial velocity.
Then, the cart hits the spring compressing it. The maximum compression occurs when the cart stops, and at that point the kinetic energy of the cart is zero, so all its initial kinetic energy has been converted into elastic potential energy of the spring:

where k is the spring constant and x is the spring compression.
For energy conservation, K=U. We can calculate U first: the compression of the spring is x=60 cm=0.60 m, while the spring constant is k=250 N/m, so

So, the initial kinetic energy of the cart is also 45 J, and from (1) we can find the value of the initial velocity: