Given a linked list, return the node where the cycle begins. If there is no cycle, return null.
Note: Do not modify the linked list.
Follow up:
Can you solve it without using extra space?
解法1:
一个老题。快慢两个指针,等相遇的时候slow继续往前走一个然后继续前行,fast回到原点然后一次一步直到再次相遇就是他们的交点。
C++
Java