Solution :
The total charge enclosed in the dotted portion when the switch $$S$$ is open is zero. When the switch is closed and steady state is reached, the current $$I$$ coming from the battery is
$$9 = I\left( {3 + 6} \right) \Rightarrow I = 1A$$

∴ Potential difference across $$3\Omega $$ resistance = $$3V$$ and
potential difference across $$6\Omega $$ resistance = $$6V$$
∴ p.d. across $$3\,\mu F$$ capacitor = $$3V$$
and p.d. across $$6\,\mu F$$ capacitor = $$6V$$
∴ Charge on $$3\,\mu F$$ capacitor $${Q_1} = 3 \times 3 = 9\mu C$$
Charge on $$6\,\mu F$$ capacitor $${Q_2} = 6 \times 6 = 36\mu C$$
∴ Charge passing the switch $$ = 36 - 9 = 27\,\mu C$$