Question : A does half as much work as B in 3/4th of the time. Together they take 18 days to complete the work. How much time shall B take to do it?

Did it as follows.

Assumed B takes 12 days to to do 12 work. (Rate 1w/day)

So, A does 6 work(half as much as B) in 9 days (3/4th of the time taken by B to do the same) so the rate is 6/9 = 2/3 work per day)

Given they take 18 days to complete the work. One day they do (1+2/3) = 5/3 work, in 18 days they do 30 work.

Hence B shall take 30 days to do 30 work since the rate of B is 1w/ day.

But the answer given is 45 days.

Is there any logic fail in the method I used?