Pls tell that why the code is not working. Pls revert back asap

@Madhavendra-Gupta-2240591552663161 hey ,I have made few changes in code with comment please see to it.

why we use the condition ptr2->next!=loopnode. ptr2 is at loop node only.

pls give appropriate explanation with eg.

@Madhavendra-Gupta-2240591552663161 this condition is applied so that pointer loop me bar bar na ghumta rhe ,ap ek eg pr code dry run krlo with cycle and without cycle pr bhi ap smjh jaoge.