Call

B alone finish work in x days
A alone work in x - 5
A one day works= 1/(x-5) and B one day works = 1/x
A+B one day work = 1/6
so, 1/(x-5) + 1/x =1/6
x+x-5/x(x-5) = 1/6,
2x-5/x(x-5) =1/6
6(2x-5) = x(x-5),
12x-30 = x2 - 5x,
x2 -17x +30 = 0
Solving quadratic equation we get x = 15 or 2

So, B alone can finish the work in 15 days.