I'm failing 3/10 testcases

I don’t know what the issue with my code is but it’s not passing all the testcases. Code: https://ide.codingblocks.com/s/650629

hi @mitrapranav0027_5d705c8b616e0add
try 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.

I changed my code to add the if(fast==head) condition but it’s still not working for 3 testcases. I think it’s giving TLE issue. Please check my code and tell me the issue: https://ide.codingblocks.com/s/650629

hi @mitrapranav0027_5d705c8b616e0add
it may be due to edge cases, where list contains no node or a single node…
if u still face any difficulty, dry run my code…
Hope it will clear your doubt…

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.