Now, we need to proof that, if there's a loop in the list, p1 will meet p2. p1 obviously will exceed p2. Asp1can only added two steps every time, there're only two relative positions betweenp1andp2. p1just beforep2. Then as p1 updates first, p2 updates second, they'll meet....
Commits BreadcrumbsHistory for leetcode Find the first node of loop in linked list - GFG onmain User selector All users DatepickerAll time Commit History Loading Footer © 2025 GitHub, Inc. Footer navigation Terms Privacy Security Status Docs Contact Manage cookies Do not share...
you would find plethora of interview experiences for Amazon. Practice those question hard. GeeksforGeeks would be the best place to prepare for it. Go for it in a structured way, e.g. lets say do all array then link