Treat the collision first and solve for the speed of the second block, then solve for the spring compression.
3 . You attach little magnetic bumpers to thesecond block and repeat the experiment : youslide a block ( m ) along a frictionless surface2 mwith speed v . It collides with and elasticallybounces off of the second block ( 2 m ) that is2 mattached to the end of the spring ( 2 ) . Howmuch does the spring compress ? Give youranswer in terms of m . Kand v