We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I've just opened up and read editorial and I found the way problem is stated is misleading to programmers who are not aware of undirected graph corollaries.
For example these two statements are irrelevant to the solution because any traversal after the query node is irrelevant and the distances are equal to max distance between any two nodes in graph.
There might be more than 1 such cities. In that case, Fedya will choose a city that was already visited as less times as possible in this journey.
There still might be more than 1 such cities. In that case, Fedya will go to the city with the smallest number.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Journey Scheduling
You are viewing a single comment's thread. Return to all comments →
I've just opened up and read editorial and I found the way problem is stated is misleading to programmers who are not aware of undirected graph corollaries. For example these two statements are irrelevant to the solution because any traversal after the query node is irrelevant and the distances are equal to max distance between any two nodes in graph.
There might be more than 1 such cities. In that case, Fedya will choose a city that was already visited as less times as possible in this journey.
There still might be more than 1 such cities. In that case, Fedya will go to the city with the smallest number.