#82

from utils.listNode import ListNode

class Solution:
    def remove_duplicates(self, head):
        if not head:
            return head
        
        curr, runner = head, head.next

        while runner:
            if curr.value != runner.value:
                curr.next = runner
                curr = curr.next
                
            runner = runner.next
        
        curr.next = None
        return head

one = ListNode(1)
two = ListNode(1)
three = ListNode(3)
four = ListNode(3)
five = ListNode(4)
six = ListNode(4)
seven = ListNode(5)

one.next = two
two.next = three
three.next = four
four.next = five
five.next = six
six.next = seven

print(one)

solution = Solution()
print(solution.remove_duplicates(one))