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:
Time taken by A to complete the work = 15 days
Time taken by B to complete the work = 10 days
Work done by A in a day = 1/15
Work done by B in a day = 1/10
Work done by A and B together in a day = 1/15 + 1/10 = 1/6
So work done by A and B together in a two days = 1/3
Work remaining when B leaves = 1 - 1/3 = 2/3
Now, A alone completes the remaining 2/3 work
Time taken by A to complete 2/3 work = 2/3 $\times$ 15 = 10 days.
So total time taken to complete the work = (2+ 10) days = 12 days.