The initial momentum of the system can be expressed as,
The final momentum of the system can be given as,
According to conservation of momentum,
Plug in the known expressions,
Initially, the second mass move towards the first mass therefore the initial speed of second mass will be taken as negative and the recoil velocity of first mass is also taken as negative.
Plug in the known values,
Thus, the final velocity of second mass is 2.99 m/s.