CodeMentor
.
Ask AI
Problems
Learn
C++
TCS
Core CS
HR
Progress
Search
Ctrl
K
0
Lv 1
Problems
Linked List
Linked List Cycle
Easy
LeetCode
3/3
00:00
Hint
Run
Ctrl
↵
Submit
Description
Lesson
Code walk
Solution
Easy
Linked List
LeetCode #141
Linked List Cycle
Floyd: slow +1, fast +2. Meet ⇒ cycle.
Examples
Example 1
Input
4 1 3 2 0 -4
Output
true
Example 2
Input
2 -1 1 2
Output
false
Stuck? Take a nudge
Reveal hint 1 of 3
C++17
Autosaves
Reset
Console
Run your code to see results