Solution partially accepted

In this question of determination of floyd cycle and rectifying it,
I have written the function in the code :
I am getting 7/11 test cases passed.
The link of my code :

when the LL does not have a cycle then it gives run time

image
this condition wont ever be fulfilled

please update the while condition
if u need help ping back

I need help on how to resolve the condition…