This is a solution
18 on the hard interview questions node
. If you have not read the question
, the follow
ing will make no sense
Here's some code that will do the trick:
The idea is that both robots start moving right, and eventually the one on the left will be at the other robot's start, at which point it starts moving twice as fast to catch up to the other robot, which will obviously never hit the first robot's start.