Need help, not sure if I got the correct answer.

The length of the ladder is 15 feet.
Solution:
Let the length of the ladder be x.
Distance from ground to the top of the ladder = x – 3
Distance from the bottom of the ladder to the building = 9 feet
To find the length of the ladder:
Using Pythagoras theorem,
[tex]\text{Base}^2+\text{Height}^2=\text{Hypotenuse}^2[/tex]
[tex]9^2+(x-3)^2=x^2[/tex]
[tex]81+x^2-6x+9=x^2[/tex]
[tex]x^2-6x+90=x^2[/tex]
Subtract [tex]x^2[/tex] from both sides of the equation, we get
[tex]-6x+90=0[/tex]
Subtract 90 from both sides of the equation.
–6x = –90
Divide by –6 on both sides of the equation.
x = 15
Hence the length of the ladder is 15 feet.