C++ || 0ms || Short & Simple Code || ✅⭐⭐
DO UPVOTE IF IT HELPS !!!!\n\nLL = 1 -> 2 -> 3 -> 4-> 5 -> null & n=2\n\n1. Initially slow = head, fast = head\n2. Fast is initialised \'n+1\' positions ahead.\
***DO UPVOTE IF IT HELPS !!!!***\n\nLL = **1 -> 2 -> 3 -> 4-> 5 -> null** & n=2\n\n1. Initially slow = head, fast = head\n2. Fast is initialised **\'n+1\' positions ahead**.\n3. Thus, **slow = 1 and fast = 4** (n+1 positions ahead i.e. 2+1 = 3 positions ahead). \n4. While fast!=NULL, increment **both slow and fast by one**.\n5. Therefore, slow = 2, fast = 5\n6. Now, slow = 3, fast = NULL, hence exit form while loop\n7. Now update **slow->next = slow->next->next.**\n\n**TC** = O(N), **SC** = O(1)\n\n\t  ListNode* removeNthFromEnd(ListNode* head, int n) {\n        \n        if(head==NULL) return head;\n        \n        ListNode *s=head, *f=head;          //2 pointers, slow=head\n        \n        for(int i=1;i<=n+1;i++){            //fast is initialised \'n+1\' positions ahead\n            if(f==NULL) return head->next;  \n            f=f->next;\n        }\n        \n        while(f!=NULL){                     //when fast is NULL, exit\n            s=s->next;\n            f=f->next;\n        }\n        \n        s->next=s->next->next;              //update connection\n        return head;\n    }
['Linked List', 'Two Pointers', 'C']