A's 1 days' work =145,B's 1 days' work =140
Suppose A left the work after x days of the start of the work. Then,
Work done by A in x days =x45
Work done by B in (x+23) days =(x+23)40
Given, x45+(x+23)40=1⇒(8x+9x+207)360=1
⇒17x=360−207=153⇒x=15317=9 days
∴A left after 9 days of start of work.