[Python 3] ✅ O(1) Space Solution 🔥
UPVOTE IF YOU LIKE ;)\n\n\n# Code\npy\nclass Solution:\n    def deleteDuplicates(self, head: Optional[ListNode]) -> Optional[ListNode]:\n        # Base Case\n  
##### UPVOTE IF YOU LIKE ;)\n![SpidermanTobeyMaguireGIF.gif](https://assets.leetcode.com/users/images/b55a37a9-a9f5-4be8-a13e-455c0a0a2714_1693289534.1989064.gif)\n\n# Code\n```py\nclass Solution:\n    def deleteDuplicates(self, head: Optional[ListNode]) -> Optional[ListNode]:\n        # Base Case\n        if not head: return None\n        \n        # Dummy Node\n        dummy = ListNode(0, head)\n\n        # dup\'s initial value is a value that \n        # a node cannot have in this problem\n        prev, cur = dummy, head\n        dup = -101\n        while cur.next:\n            # If a duplicate is found, save that value\n            if cur.val == cur.next.val:\n                dup = cur.val\n            \n            # If the current node\'s value is dup\n            # Remove the current node\n            if cur.val == dup:\n                prev.next = cur.next\n\n            # If not just update prev to its next node                \n            else:\n                prev = prev.next\n\n            cur = cur.next\n\n        # Check the last node\n        if cur.val == dup:\n            prev.next = None\n        \n        return dummy.next\n            \n```\n\n# Explanation\nCheck my blog for detailed explanations: https://gaebalogaebal.tistory.com/82\n\n# Complexity\n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->
['Linked List', 'Two Pointers', 'Python3']