Algorithm · Google · Medium
You receive a collection of bidirectional links between entities along with several requests. For every request (s, t), decide whether one can travel from s to t through the relationship links. Input (standard input) The opening line contains two integers, n m, representing the number of relationship pairs and the number of requests. Each of the following n lines contains two strings, u v, describing a two-way connection between u and v. Each of the next m lines contains two…
Checking your access…