Assuming open chamber
`V_("relative")=0.5 m//s`
`S_("relative")=4m`
time `=4/0.5=8 m//s`
Alternate
Assuming closed chamber
In the frame of of chamber:
Maximum displacement of ball A from its left end is
`u_(A)^(2)/(2a)=((0.3)^(2))/(2(2))=0.0225 m`
This is negligible with respect to the length of chamber i.e. 4m. So, the collision will be very close to the left end.
Hence, time taken by ball B to reach left end will be given by
`S=u_(B)t+1/2 at^(2)`
`4=(0.2)(t)+1/2 (2)(t)^(2)`
Solving this, we get
`t~~2s`