Momentum fo two blocks and spring

I have been set this question and I'm half-way through answering it but am stuck on where to go next...here's the question:

The m1 = 1.1 kg block at rest on a horizontal frictionless surface is connected to an unstretched spring (k = 180 N/m) whose other end is fixed. (See Fig. 10-36.) The m2 = 2.2 kg block whose speed is 4.0 m/s collides with the 1.1 kg block. Assume that the two blocks stick together after the one-dimensional collision. What maximum compression of the spring occurs when the blocks momentarily stop?

Using m1v1 = m2v2 I got:

2.2 x 4.0 = 8.8kg/m/s
The joint mass of the two blocks is 3.3kg so the velocity must be 2.66m/s

But I don't understand how to calculate the spring compression knowing only the velocity and the "k" value of the spring?

Good. You have the velocity of the composite mass which now presses against the spring.

Hint: What happens to the (composite mass + spring system) as the composite mass moves forward pressing against the spring? What happens to the velocity of the mass at maximum compression? What happens to the initial kinetic energy? Can you relate these two parameters now?

So is this value supposed to equal the PE of the compressed spring? And if it does, I don't really see how that helps me answer the question, as mgh won't tell me the length of compression...is there a different formula I need to use?

The key with the spring is
an unstretched spring (k = 180 N/m)
Spring force, F = kx, and PE in spring is just the integral of F dx = 1/2 kx2, where is the displacement from fully relaxed (i.e. no force applied).
The spring reaches maximum deflection when the velocity of blocks = 0, i.e. the KE of the blocks is completely transformed into the stored mechanical energy or PE of the spring.