1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-19 20:16:48 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-03-29 12:43:11 +08:00
parent 58bbdfd57c
commit 2b0511d272
10721 changed files with 8123 additions and 8119 deletions

View File

@@ -0,0 +1,24 @@
<p>Given a circular linked list, implement an algorithm that returns the node at the beginning of the loop.</p>
<p>Circular linked list: A (corrupt) linked list in which a node&#39;s next pointer points to an earlier node, so as to make a loop in the linked list.</p>
<p><strong>Example 1: </strong></p>
<pre>
<strong>Input: </strong>head = [3,2,0,-4], pos = 1
<strong>Output: </strong>tail connects to node index 1</pre>
<p><strong>Example 2: </strong></p>
<pre>
<strong>Input: </strong>head = [1,2], pos = 0
<strong>Output: </strong>tail connects to node index 0</pre>
<p><strong>Example 3: </strong></p>
<pre>
<strong>Input: </strong>head = [1], pos = -1
<strong>Output: </strong>no cycle</pre>
<p><strong>Follow Up: </strong><br />
Can you solve it without using additional space?</p>