Linked List Cycle 3 - Find length of cycle
Problem You are given the head of a linked list. Determine if the linked list has a cycle. If a cycle is present, find the length of the cycle. If no cycle is present, return 0. We have already discussed the detection of linked list - here. Examples Example 1 Input: head = [0, 1, 3, 2, 4] output: 2 Explanation: Cycle starts at node 2 ...