Two blocks, masses m1 and m2 are connected by an ideal spring of spring constant 'k' (Please see the figure in the attachment). The right block is shifted towards the left, pressing the spring by a distance 'x', and then released. We have to find the velocity of the COM of the spring-blocks system as the left block leaves the wall. (All surfaces are smooth) The leftmost block breaks of the wall when the spring will regain it's natural length. Hence, I applied the law of conservation of energy with respect to the ground, taking the spring and blocks as a system, between the times when the right block is released and the time when the left block leaves the wall. I'm not sure how to go about after this, as I have two variables, the velocity of the two blocks, and The law of conservation of momentum of the system from the ground frame won't be applicable as the wall exerts a normal reaction of the left block. Please help!!!