only two test cases passed
Linked list cycle detection and removel
@aattuull
There was just a small error. This algorithm works only when fast and slow starts from the head of the linked list. This is supported by the mathematics behind the algorithm. Work it out on paper. And initialize the fast pointer to head. Should work out.
If my answer is able to resolve your query, please mark the doubt as resolved.
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.