DEV Community

Discussion on: Remove Duplicates From Linked List - Cracking the Coding Interview, Leetcode

Collapse
 
srleyva profile image
Stephen Leyva (He/Him)

Apologies as I’m usually really bad at these Leetcode challenges, but where is traversal of the linked list happening? Is the while loop implicitly setting node equal to node.next? Thanks for the article! Always great to have these solution in the tool box!

Collapse
 
xshirl profile image
Shirley

Oops, I forgot a line! Thanks for noticing! Traversal happens when node = node.next, after the if and else statements! Sorry for forgetting haha.

Collapse
 
srleyva profile image
Stephen Leyva (He/Him)

Aww! Great! I was like another magical python thing 😂😂😂 once again thanks for the article!