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.
In this case, I feel this is an overkill. There's a constraint that the list is <=100 nodes. So, why traverse the list several times by definition until they meet.
Cycle Detection
You are viewing a single comment's thread. Return to all comments →
In this case, I feel this is an overkill. There's a constraint that the list is <=100 nodes. So, why traverse the list several times by definition until they meet.
I solved it (in Python) with a counter: