Google Tokyo | Chaining Broadcast Signals

This question is taken from here.
Question:
Chaining Broadcast Signals
We have a broadcast system with some powered-on routers. When a router receives a message, it broadcasts the same message to all other routers within its wireless range (10 feet). Then, that router shuts down, and can no longer send or receive messages. Given a list of router coordinates, tell me whether Router X can send this signal to Router Y.

image

We had to check if it possible to send a signal from one router to other.
Constraint: We dont care about whether or not we are reaching destination just take route from one to other only to the nearest one.

Can someone provide a complete solution for this?

Comments (4)