A function that determines if a singly linked list is circular and if it is, we are going to return the node where the cycle begins. This solution is based off of Robert Floyd’s algorithm.
The time complexity of this algorithm is linear: O(n).
The space complexity of this algorithm is constant: O(1).