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.
The first case in the example says: "The cities in the order of visit is 4 - > 8 -> 3 -> 8 -> 4 -> 8 -> 3". Shouldn't this be 4 -> 8 -> 3 -> 8 -> 3 -> 8 -> 4? After the second visit to 8, both 3 and 4 are candidates and both have been visited once, shouldn't the lowest index then be selected (i.e. 3 instead of 4)?
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 →
The first case in the example says: "The cities in the order of visit is 4 - > 8 -> 3 -> 8 -> 4 -> 8 -> 3". Shouldn't this be 4 -> 8 -> 3 -> 8 -> 3 -> 8 -> 4? After the second visit to 8, both 3 and 4 are candidates and both have been visited once, shouldn't the lowest index then be selected (i.e. 3 instead of 4)?