The velocity of block just before hitting the putty (by energy conservation)
K.Ei+P.Ei=K.Ef+P.Ef⇒0+mgh=12mv2⇒v=√2gh
Let the common velocity of both block and putty be v'
At collision momentum balance:
mv=mv′+mv′⇒√2gh=2v′⇒v′=√gh2
Again applying energy conservation (both block and putty at max height)
K.Ei+P.Ei=K.Ef+P.Ef⇒122mv′2=2mgh′⇒12gh2=gh′⇒h′=h/4