inlet pipe can fill the pool in 6 hours, means: every hour the pool is filled 1/6
a drain can empty the pool in 9 hours, means: every hour the pool is drained 1/9
If the inlet and the drain are both left open, every hour the pool is filled 1/6-1/9=1/18
It will take 18 hours to fill up the pool.