There is no trick in this problem. However, note that the collision between two spheres is inelastic (since they stuck together). So, the conservation of energy does not hold at that instance. However, one can use conservation of linear momentum at that moment.
I. Before A hit B
one can find the momentum of A before hitting B from the conservation of energy. Let potential energy at lowest level of the problem be zero.
Then, we can write conservation law of energy as
Total energy

zero kinetic energy

zero potential energy

(1)
, where

is the velocity of putty A before collision
2. The collision between A and B
Here we use conservation of momentum
Total momentum

(2)
,where

is the velocity of both spheres (they stuck together).
III. After the collision. All kinetic energy turned to potential energy (at maximum height, both spheres stop for a moment)
Here we can write conservation law of energy as
Total energy

zero potential energy

zero kinetic energy

(3)
, where

is the maximum height they can swing.
We can rewrite three equations as
(1)

(2)

->

(3)

Plug (3) in (2) and (2) in (1), we got

. The answer is

The correct answer is (A). Surprisingly, only 19 of 100 people answered correctly.