I prefer assuming total work before solving such questions. Helps me to avoid fractions.
ALONE
A finishes work in 20 days
B finishes work in 30 days
Taking LCM of 20 and 30 (Or any convenient common mulitple) --> 120
So if total work is 120, then to finish 120 units of work as per their current rate
A finishes work 120/20 = 6 units per day
B finishes work 120/30 = 4 units per day
Both together finish 6 + 4 = 10 units per day.
Coming back to what's asked -
B alone worked for 5 days, so 4*5 = 20 units of total 120 units is done
Together they worked for 4 hours before finishing the work = 10*4 = 40 units.
We've got 40 + 20 = 60 units done.
120-60 = 60 units pending.
This work is nothing but the work that A & B did together before A left B alone to suffer.
Hence 60/10 = 6 days!
+Kudos, if this helped!
_________________