Why is this code not working for this logic?
Please help for this one.
Question is: -
Why is this code not working for this logic?
Please help for this one.
Question is: -
Hey @cbcao263,
you have not used fast->next!=NULL in the while condition which might result in a runtime error.
I have corrected the code and commented it as well . It will get accepted now 
Hope it helps
.
If your doubt is now resolved please mark it as resolved and rate me accordingly .
Else you can further questions here .
Thankyou
Thanks Sir
For this|
And also wanna discuss that do you debug all these codes on your own right?
Isn’t it very difficult or you have done a lot of practice and that is very helpful.
Your welcome @cbcao263 
Regarding your other doubt you have to see first what kind of error are you getting for ex: if is a runtime error then you are trying to access a NULL pointer or using memory out of bounds. Now h=go to your code and see which all areas are there where you are dealing with pointers (for NULL) and arrays (for out of bound indexes) most probably you will be doing some mistakes in these code snippets only.
Sometimes you might get some error which you can’t get rid of !! What i recommend is to make 2 3 test cases which also take care of some edge cases and then dry run the code line by line . You will be able to see your mistake. It will get better with practice so keep practicing
The more you do it the better you will get at it