Getting one TLE in intersection of 2 linked list
https://ide.codingblocks.com/s/43812
I have commented the mistake.
Do let me know in case of any doubts. Happy coding.!
i that part of code i had incremented the fast twice in a single step i.e
instead of fast=fast->next fast=fast->next->next
and when i found out matching data then i went back one or zero step in case i had overshoot the meetinig point and with this method am getting tle in one case
i should not be getting that right?? if i should be then why??
I am not able to understand the point of moving two steps ahead and check the prev position. For this you have to maintain a previous pointer, or a doubly link list in short. So whats the point going two steps and coming back. Because this is not helping in reducing time complexity either.