A building is 17 ft high, what is the lenght the ladder must be to extend 3 ft higher than wall

I'd say that would be 17+3=20

assuming the ladder is laid vertically against the wall -- an unusual placement, to be sure.