I have a problem in which two carts are attached by a compressed spring. I have found that cart A$A$ moves at 1.1 m/s$1.1~\mathrm{m/s}$ to the right and has a mass of .39 kg.$0.39 ~\textrm{kg}.$ Cart B$B$ has a mass of 0.18 kg$0.18~\textrm{kg}$ and moves at 2.382 m/s$2.382~\mathrm{m/s}$ in the opposite direction. How do I use the equation U = kx^2$U = kx^2$ to find what the potential elastic energy is?
It isn't making sense to me because I don't know what the displacement of each cart is.