We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6978def commit 74ef365Copy full SHA for 74ef365
Python/chapter02/2.1 - Remove Dups/miguel_2.1_sol.py
@@ -98,7 +98,7 @@ def remove_dups_no_buffer(ll: LinkedList) -> LinkedList:
98
:return: a linked list without duplicates
99
"""
100
n = ll.head
101
- while n.next is not None:
+ while n is not None:
102
curr_data = n.data
103
m = n.next
104
prev = n
@@ -115,11 +115,6 @@ def remove_dups_no_buffer(ll: LinkedList) -> LinkedList:
115
prev = m
116
m = m.next
117
n = n.next
118
- # if the following is true, this
119
- # means we are at the end of the ll
120
- # and we removed a value at the end
121
- if n is None:
122
- break
123
return ll
124
125
0 commit comments