Skip to content

Latest commit

 

History

History
10 lines (8 loc) · 360 Bytes

note0142.md

File metadata and controls

10 lines (8 loc) · 360 Bytes

Thoughts

Stupid thought

  1. Create a set to store the traversed node
  2. Return the node which is in the set

Better thought

  1. Fast and slow pointers
  2. If fast pointer equals to slow pointer, set a new iteration from the head which is one move a time and fast pointer is made one move a time
  3. The next time they meet is the cycle begins