Explanation:
AC = 24 and AD = 6.
that means that DC = 24 - 6 = 18
the height of a right-angled triangle to the Hypotenuse is the square root of the product of the lengths of the 2 Hypotenuse segments.
in our case
BD = sqrt(AD × DC) = sqrt(6 × 18) = sqrt(108)
but this height is also creating another right-angled triangle with the first Hypotenuse segment (AD) and the side AB.
and we can use Pythagoras to calculate AB :
AB² = BD² + AD² = 108 + 6² = 108 + 36 = 144
AB = sqrt(144) = 12