Single pass python solution | O(N) | Easy | SR
Please upvote if you get this\n\nclass Solution:\n    def removeNthFromEnd(self, head: Optional[ListNode], n: int) -> Optional[ListNode]:\n        i,j=head, hea
**Please upvote if you get this**\n```\nclass Solution:\n    def removeNthFromEnd(self, head: Optional[ListNode], n: int) -> Optional[ListNode]:\n        i,j=head, head\n        for k in range(n):\n            j = j.next\n        #now i and j will be at difference n\n        if j == None: #Only happens when we are supposed to remove the first element\n            return head.next\n        while j.next != None:\n            i = i.next\n            j = j.next\n        i.next = i.next.next\n        return head\n\n```
['Linked List', 'Two Pointers', 'Python', 'Python3']