The faucet can fill the bottle in 10 seconds ... it fills 1/10 of the bottle each second.
The hole drains the bottle in 30 seconds ... it drains 1/30 of the bottle in 1 second.
If the faucet and the hole are both working at the same time, then the bottle is filling at the rate of (1/10 of a bottle) - (1/30 of a bottle) each second.
That number is (1/10 - 1/30) = (3/30 - 1/30) = (2/30) = 1/15 bottle per second.
The bottle is filling at the rate of 1/15 bottle per second.
So it'll be filled to the rim of the brim in 15 seconds.