Distance between the closest wall and Sunil = 360m
Time after which he hears echo = 4s
Velocity of sound = 2(Distance/time)
= 360*2/4
= 180m/s
Let distance between two walls be (x)m
Distance of another wall from Sunil = (x - 360)m
Time after which he hears echo = 4s + 2s = 6s
Velocity of sound = 2(Distance)/time
= 2(x-360)/6
Hence,
180 = 2(x-360)/6 (Velocity of sound remains constant)
⇒1080 = 2(x-360)
⇒540 = x - 360
⇒x = 540 + 360
Distance between two walls=900m