Detect And Remove Loop From Linked List

I am getting runtime error for one test case, all other are working fine. My code is : https://ide.codingblocks.com/s/307016

@gourav hey handle that case when there is no loop or there is one lement or corner cases like this.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.