A and B can complete a work in 15 days and 10 days respectively. They started doing the work together but after 2 days B had to leave and A alone completed the remaining work. The whole work was completed in :
$\left(A + B\right)$s 1 days work =$ \left(\dfrac{1}{15} +\dfrac{1}{10} \right) $=$ \dfrac{1}{6} $.
Work done by A and B in 2 days =$ \left(\dfrac{1}{6} \times 2\right) $=$ \dfrac{1}{3} $.
Remaining work =$ \left(1 -\dfrac{1}{3} \right) $=$ \dfrac{2}{3} $.
Now,$ \dfrac{1}{15} $work is done by A in 1 day.
$ \dfrac{2}{3} $work will be done by a in 15 $\times \dfrac{2}{3} $ = 10 days.
Hence, the total time taken = $\left(10 + 2\right)$ = 12 days.