Let the leak empties the full tank in x h, then
Part emptied in 1 by leak = 1/x
Part filled by inlet in 1 h = 1/20
According to the question,
1/20 + 1/x = 1/40
∴ 1/x = 1/40 - 1/20 = 1- 2/40 = -1/40 [-ve sign Indicates emptying.]
Clearly, leak will empty the full tank in 40 h.