Problem Statement
Given head, the head of a linked list, determine if the linked list has a cycle in it.
Approach
Use two pointers, slow and fast. Slow moves one step at a time, fast moves two. If there is a cycle, the fast pointer will eventually catch up to the slow pointer within the cycle. If fast reaches the end (null), there is no cycle.
Time & Space Complexity
Time complexity is O(n). Space complexity is O(1).
