142 Linked List Cycle II
Last updated
Was this helpful?
Last updated
Was this helpful?
Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull
.
Note:Do not modify the linked list.
Follow up: Can you solve it without using extra space?
同上题一样,花空间的要用hashset。不用的话,就双指针。解法竟然跟 一样