Question
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?
Explanation
和上面一道题不一样的地方就是要输出从哪里开始。真的是不看答案想不出来..贴一个我觉得比较清楚的讲解吧:
Reference:https://discuss.leetcode.com/topic/27868/concise-java-solution-based-on-slow-fast-pointers