Linked List • Easy

Linked List Cycle

Given `head`, the head of a linked list, determine if the linked list has a cycle in it. Return `true` if there is a cycle, and `false` otherwise.

The Challenge

Given `head`, the head of a linked list, determine if the linked list has a cycle in it. Return `true` if there is a cycle, and `false` otherwise.

Difficulty Easy
Topic Linked List

Pro-tip: Use Floyd's Cycle Finding Algorithm (two pointers, fast and slow).

Solution.swift Tests.swift
Output
Ready to run.