C++ || Efficient || two-pointers || with comments & explanation ||
If you understand the approach please please upvote!!!\uD83D\uDC4D\nThanks :)\n\nclass Solution {\npublic:\n    ListNode* removeNthFromEnd(ListNode* head, int n
##### If you understand the approach please please upvote!!!\uD83D\uDC4D\n***Thanks :)***\n```\nclass Solution {\npublic:\n    ListNode* removeNthFromEnd(ListNode* head, int n) {\n        ListNode *slow=head;\n        ListNode *fast=head;\n        while(n--) fast = fast -> next;//iterate first n nodes using fast\n\t    if(!fast) return head -> next; //if fast is already null, it means we have to delete head itself. So, just return next of head\n        while(fast->next){//iterate till fast reaches the last node of list\n            slow=slow->next; \n            fast=fast->next;\n        }\n        slow->next=slow->next->next;// remove the nth node from last\n        return head;\n    }\n};\n```
['Linked List', 'Two Pointers', 'C', 'C++']