Thanks for your question!
Because an essentially elastic collision happens between both vehicles, almost all the energy in the rear-ending car is transmitted to the rear-ended car. Thus, the initial and final momentum should be the same. Because car A's momentum is equal to mv, so should car B's. (Note, however, that if the question had asked you to calculate car B's speed, it would have been half that of car A because car B has twice the mass of car A.)
This webpage of the Alloprof website explains impulse and momentum:
Don't hesitate if you need more help!
Deleting this explanation will also permanently delete the question. Do you want to continue?