title: Removing Duplicates in a linked list recursively
body: <p>I am trying to write a recursive function that removes all adjacent duplicates in a linked list. However, my function is not working properly.</p>
  
  <p>This is my attempt:</p>
  
  <pre><code>class Node:
      """Node in a linked list"""
  
      def __init__(self: 'Node', value: object = None, next: 'Node' = None) -&gt; None:
          """Create Node self with data value and successor next."""
          self.value, self.next = value, next
  
  def remove_dup(lnk):
      if not lnk or lnk.next:
          return lnk
      if lnk.value == lnk.next.value:
          lnk.next = lnk.next.next
      else:
          return remove_dup(lnk.next)
  </code></pre>