So the base of the ladder will be 9 feet from the fence, which is 1 foot from the building, so it will be 10 feet from the building. The top of the ladder will reach the window which is 13 feet above the ground. So we have a right triangle with the ladder as the hypotenuse, and we know the two sides, so we can use the Pythagorean Theorem.
c2 = a2 + b2
c2 = 132 + 102
c2 = 169 + 100
c = √269 = 16.40
So the ladder would need to be 16.4 feet long.