Detect loop point
By (Slow pointer and fast pointer approach), find the loop detection node
Now take pointers P1 and P2, P1 at the loop detection node and P2 starting from head of the linked list
Traverse both the pointers one at a time
Both the pointers meet at the node because of which there is a loop in the linked list
Use the standard fast and slow pointer algorithm find the loop detection point
Take two pointers P1 and P2 at loop detection point. Place pointer P1 at the same place and move P2 forward one step at a time. Repeat until both the pointers meet together. Keep a count variable incremented for every iteration which gives length of the loop. Let say the length is L1
Again take two pointers P1 and P2. P1 at the head of the linked list and P2 at the loop detection point. Forward both the pointers one step at a time. Repeat until both the pointers meet together. This procedure is equivalent to the one we use to calculate node that causes loop in a linked list. Keep a count variable incremented for every iteration which gives the length of the list until the merging point. Let say the length is L2
Now the length of the list that contains loop is L1+ L2