Solution:
A → 4 hours
B → 6 hours
According to question,
⇒ For the first hour tap A is opened and B for second hour
⇒ Work done by both in 2 hours
$$\eqalign{
& \to \left( {3\,{\text{lit/h}} + 2\,{\text{lit/h}}} \right) \times 2 = 10\,{\text{units}} \cr
& \,\,\,\,\,\,\,\,\mathop {\,\,|\,\,\, \times 2}\limits_{{\text{4 hours}}}^{{\text{2 hours}}} \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\mathop {\,\,|\,\,\, \times 2}\limits_{{\text{10 litres}}}^{{\text{5 liters}}\,} \cr} $$
⇒ Remaining part
= 12 - 10 = 2 liters
⇒ Again 5th hour A will be opened Tap A will fill the 2 liters water with its efficiency = $$\frac{2}{3}$$ hours
⇒ Therefore tank will be filled in
= $$\left( {4 + \frac{2}{3}} \right)$$ hours
= $${\text{4}}\frac{2}{3}$$ hours