Please help me in this one

Hey @cbcao263 ,
The current code which you have written is working on leetcode.
If you write the “if” condition in the loop before moving the fast and the slow pointer forward it will show error because in the first iteration both the slow and the fast pointer is at the head of the linked list .
So it will always return true. Even when there is no loop . Dry run once with some LL which does not have a cycle you will still return true . Because in the first iteration fast == slow .

Hope it helps :blush: .
If your doubt is now resolved please mark it as resolved and rate me accordingly .
Else you can further questions here .
Thankyou