First pipe can empty tank in 60 mins
So water drained by it in 18 mins = 1860
When second pipe is opened which can fill tank in 30 mins.
Both pipe together can fill the tank in 60 mins
So time taken to fill 1860 of tank = 1860× 60 = 18 mins
So Total time taken = 18 + 18 = 36 minutes