Intuitively, we would approach this problem with a set and just check if the node we are visiting are in the set, however, that would be time and space complexity.
We can optimize our approach by utilizing slow and fast pointers where the logic relies on the concept that if the slow pointer somehow caught up to the fast one, there must be a cycle within the linked list!