WaymoSoftware Engineer · OnsiteCodemia practiceCount cycle in linked list
Given a linked list, determine if it contains a cycle and, if so, count the number of nodes in the cycle. Your function should return the count of nodes in the cycle, or 0 if there is no cycle. The input will be the head of the linked list, and the output should be an integer representing the count of nodes in the cycle.