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.
After putting far too much time into reworking code that passed the 0-th test case and no others, I finally ended up with a proper solution which immediately passed every test case. I have to say, it feels more than a little malicious that the only visible test case lists every edge in (parent, child) order, yet apparently none of the hidden test cases do so. And for a challenge titled "Java Visitor Pattern", there's really no reason for any significant portion - much less the brunt - of the challenge to be in understanding the structure of a specific representation of an adjacency list rather than in understanding, say, the Visitor Pattern.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Visitor Pattern
You are viewing a single comment's thread. Return to all comments →
After putting far too much time into reworking code that passed the 0-th test case and no others, I finally ended up with a proper solution which immediately passed every test case. I have to say, it feels more than a little malicious that the only visible test case lists every edge in (parent, child) order, yet apparently none of the hidden test cases do so. And for a challenge titled "Java Visitor Pattern", there's really no reason for any significant portion - much less the brunt - of the challenge to be in understanding the structure of a specific representation of an adjacency list rather than in understanding, say, the Visitor Pattern.