Pipe A - can fill the tank in 20 hrs. Hence, in 1 hr it can fill 1/20th of the tank.
Pipe B - can fill the tank in 30 hrs. Hence, in 1 hr it can fill 1/30th of the tank.
Therefore, when both pipes are opened, (1/20 + 1/30 =) 1/12th of the tank is filled in an hr. It'll take both the pipes 12 hrs to fill the tank completely.
When 1/3rd of the tank is filled, both the pipes would have been opened for (1/3 = 4/12 = 4*(1/12)) 4 hrs.
Now, 2/3rd (= 8/12) of the tank remains to be filled.
However, at this stage due to the leak in the tank, 1/3rd of the water supplied by the pipes leaks.
So, now only (2/3 * 1/12 = ) 1/18th of the tank is filled in an hour instead of 1/12th earlier.
At this rate it would have taken 18 hrs to fill the tank if it were completely empty.
However, since only 8/12th of the tank needs to be filled, it'd take another (8/12 * 18 =) 12 hrs to completely fill the tank.
Therefore, the tank would be completely filled in (4 + 12 =) 16 hrs.