Answer:
t = S / V where S is distance sound travels and V the speed of sound
S = 20 + 20 - v t where v is speed of bat and t time to hear echo
S = 40 - v t
t = (40 - S) / v = (40 - V t) / v substituting S from 1st equation
v t + V t = 40
t = 40 / (v + V) = 40 / (340 + 2) = .117 sec = 117 ms