Answer
The maximum height attained by the two bobs after the collision is $\frac{h}{9}$
Work Step by Step
Let $M$ be the mass of bob A.
Then $2M$ is the mass of bob B.
Let $v_A$ be bob A's speed just before the collision. We can use conservation of momentum to find the speed $v_f$ just after the collision:
$m_f~v_f = m_A~v_A$
$(M+2M)~v_f = M~v_A$
$v_f = \frac{v_A}{3}$
We can use conservation of energy to find an expression for $v_A$ in terms of $h$:
$KE_0=U_0$
$\frac{1}{2}Mv_A^2 = Mgh$
$v_A = \sqrt{2gh}$
We can use conservation of energy to find the maximum height $h_f$ attained by the two bobs after the collision:
$U_f = KE_f$
$(3M)gh_f = \frac{1}{2}(3M)(\frac{v_A}{3})^2$
$gh_f = \frac{1}{2}(\frac{v_A}{3})^2$
$gh_f = \frac{1}{2}(\frac{\sqrt{2gh}}{3})^2$
$gh_f = \frac{1}{2}(\frac{2gh}{9})$
$h_f = \frac{h}{9}$
The maximum height attained by the two bobs after the collision is $\frac{h}{9}$.