The best way to deal with these problems is to first make a sketch. The sketch should look like a triangle with the wall on the left of height (h), the ground at the bottom with the ladder forming the diagonal starting at the top of the wall and touching the ground at distance (d) from the wall. The diagonal length is L, or the length of the ladder.
The pythagoream theorem can be used which would be L^2=h^2+d^2 in this case. To find h, re-arrange the formula to be h=sqrt(L^2-d^2). Substitute the given values to calculate h = SQRT(22^2-18^2) = 12.6 feet (rounded to nearest 10th).
This ladder would be hard to climb as it's angle to the ground is too flat.