Work is done when spring is extended or compressed. Elastic potential energy is stored in the spring. Provided inelastic deformation has not happened, the work done is equal to the elastic potential energy stored.
Answer:The mass of ball B is 10 kg.
Explanation;
Mass of ball A = 
Velocity of the ball A before collision:
Velocity of ball A after collision=
Mass of ball B= 
Velocity of the ball B before collision:
Velocity of ball B after collision=



The mass of ball B is 10 kg.
Scalar Quantity :-
→ These are the quantities with magnitude only . These quantities doesn't have to be mentioned with direction
eg.)=> Mass , Temprature .
Vector Quantity :-
→ These quantities are described with both Magnitude and Direction . These quantities follow special type of algebra called Vector algebra .
eg.)=> Force , Displacement
_______________________________
Hope It Helps You. ☺