The largest triangle and the triangle whose hypotenuse is x are similar. So:
(21 + 4)/x = x/4
Cross multiply:
x^2 = 100
x = 10
Your answer is incorrect. It should be 10, not 20.