Skip to content

Instantly share code, notes, and snippets.

@ericness
Created March 26, 2022 03:00
Show Gist options
  • Save ericness/eb6eb945936428ebaad1d63a30c993f6 to your computer and use it in GitHub Desktop.
Save ericness/eb6eb945936428ebaad1d63a30c993f6 to your computer and use it in GitHub Desktop.
19 two pass solution
if current == head and node_to_remove == 0:
head = current.next
elif current.next:
current.next = current.next.next
else:
current.next = None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment