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.
Not sure what's up with the testcase either, but the reason why it's not passing is because it says "revisiting a node." A node consists more than just the node.data. Two different nodes can have the same data. So to check node.data is the wrong logic.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Cycle Detection
You are viewing a single comment's thread. Return to all comments →
Not sure what's up with the testcase either, but the reason why it's not passing is because it says "revisiting a node." A node consists more than just the node.data. Two different nodes can have the same data. So to check node.data is the wrong logic.