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.
Ok, I am flummoxed by this. I've been working on this for a couple of weeks and have given things several passes, and have tried to optimize things as best I can, but I am still getting either wrong answers or time-outs.
My approaches have included the following steps to try to minimize complexity:
* Eliminate "worthless" nodes, replacing them with roads of equivalent length.
* Establishing optimal road-connections between all nodes.
* Using BitSets to hold the "fish" data, and only running checks for completion when a path containing a new set of fish is discovered.
I see that the difficulty of this is marked as only "moderate," so I assume that there may be some trick to this. Something that would be taught in a course on algorithms, perhaps? If someone could point me toward an online resource that I can use to understand useful tactics for approaching this problem, I would really appreciate it.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Synchronous Shopping
You are viewing a single comment's thread. Return to all comments →
Ok, I am flummoxed by this. I've been working on this for a couple of weeks and have given things several passes, and have tried to optimize things as best I can, but I am still getting either wrong answers or time-outs. My approaches have included the following steps to try to minimize complexity: * Eliminate "worthless" nodes, replacing them with roads of equivalent length. * Establishing optimal road-connections between all nodes. * Using BitSets to hold the "fish" data, and only running checks for completion when a path containing a new set of fish is discovered.
I see that the difficulty of this is marked as only "moderate," so I assume that there may be some trick to this. Something that would be taught in a course on algorithms, perhaps? If someone could point me toward an online resource that I can use to understand useful tactics for approaching this problem, I would really appreciate it.