Two bars of masses m1 and m2 connected by a non-deformed light spring rest on a horizontal plane. The coefficient of friction between the bars and the surface is equal to k. What minimum constant force has to be applied in the horizontal direction to the bar of mass m1 in order to shift the other bar?

My approach was to set the force on m2 = 0, so the spring force equals the friction force. Then I set the force on m1 = 0, so the force equals the spring force plus the friction force on m1. This gives the answer as F=k(m1+m2)g.

However the correct solution is found by setting the work done by block 1 = 0, which gives k(m1+(m2)/2)g.

Can someone help me physically understand why the solution would be found by setting the work done equal to zero rather than the net forces equal to zero?

Thanks for the help!