0% completed
Anyone else feel like line 6 of solution needs more explanation?
anya.dipalma
Sep 15, 2023
"As pointer2 is ‘K’ nodes ahead of pointer1, which means, pointer2 must have completed one loop in the cycle when both pointers meet. Their meeting point will be the start of the cycle."
But WHY must their meeting point be the start of cycle? I get that pointer2 is k nodes ahead of pointer1 and that when both pointers meet, pointer2 will b k nodes in the cycle but why does that mean it'll be the start of cycle?
8
0
Comments
adi berkowitz10 months ago
I agree. Not only is the solution written not the one you should use in any coding exercies. But the explanation is EXTREMELY lacking. This should be fixed
Tu Huy Nguyen9 months ago
So let's say when pointer1 reaches the start of the cycle, pointer2 is already k (length of the cycle) nodes ahead of pointer1 -> The only place where they can meet is the start of the cycle.
Moreover, because pointer1 moves 1 step at a time, it must inevita...
On this page