Took me a while to figure this out; so find the equation of the displacement of both particles.
You should get x(1)=-(1/k)[gt+(1/k)(g+ku)(e^(-kt)-1)] and x(2)=(1/k)[gt+(1/k)(g-ku)(e^(-kt)-1)].
These two particles will intersect when x(1)+x(2)=d. Make t the subject and it comes out