You are viewing a single comment's thread. Return to all comments →
Right in the problem it says:
Constraints:
0 <= list size <= 100
So if we've iterated through the list 101 times, there has to be a cycle.
Seems like cookies are disabled on this browser, please enable them to open this website
Linked Lists: Detect a Cycle
You are viewing a single comment's thread. Return to all comments →
Right in the problem it says:
Constraints:
0 <= list size <= 100
So if we've iterated through the list 101 times, there has to be a cycle.