20%off off — LaunchSpecial
Exercises/#22 Detect Cycle in Linked List
#22

Detect Cycle in Linked List

Easy🔗 Linked Lists
60 XP

Problem

Given the head of a linked list, determine if the linked list has a cycle in it.

Examples

Input: 3 → 2 → 0 → -4 → (back to 2)
Output: true

Input: 1 → 2 → (no cycle)
Output: false
linked-listtwo-pointerfloyd
AI Assistant— powered by AI

Unlock hints progressively — start gentle, go deeper only if needed.

💡

Level 1: Gentle Nudge

A subtle direction

🗺️

Level 2: Approach

The algorithm to use

🔍

Level 3: Detailed

Step-by-step guidance

22 / 150

Your Solution

⚡ JavaScript

to save progress and use AI features