The problem is that this collision is inelastic so energy is not conserved. The collision is, in fact, totally inelastic so that the two blocks travel as one after the collision. The problem says that the two blocks, total mass 14 kg, move together after the collision with speed 10 m/s.
