Given a linked list of size N, your task is to complete the function countNodesinLoop() that checks whether a given Linked List contains loop or not and if loop is present then return the count of nodes in loop or else return 0.
For Example: Size of the loop in the below linked list is 4.
The function takes a single argument as input, the reference pointer to the head of the linked list.
There will be T, test cases and for each test case the function will be called separately.
For each test case the function must return the size of the loop in the linked list or else 0.
25 14 19 33 10 21 39 90 58 45
Note:The Input/Ouput format and Example given are used for system's internal purpose, and should be used by a user for Expected Output only. As it is a function problem, hence a user should not read any input from stdin/console. The task is to complete the function specified, and not to write the full code.