C++ | One pass | 100% fast | Recursion | Solution with picture
\n\n\n\t\n\tclass Solution {\n\tpublic:\n    int remove(ListNode head, int n)\n    {\n        if(head==NULL)\n            return 0;\n        \n        int steps
\n![image](https://assets.leetcode.com/users/images/263aacc8-9c23-403b-b1b0-4ea6dd31b992_1634740578.2843018.jpeg)\n\n\t\n\tclass Solution {\n\tpublic:\n    int remove(ListNode* head, int n)\n    {\n        if(head==NULL)\n            return 0;\n        \n        int steps = remove(head->next, n); //steps to reach the last node from head->next node\n            \n        if(steps == n)   //if head->next is the node that we need to remove\n            head->next = head->next->next;   //then remove it\n        \n        return steps+1;\n    }\n\t\n    ListNode* removeNthFromEnd(ListNode* head, int n) {\n        \n        if(remove(head, n) == n)   //if head is the node that we need to remove \n            head = head->next;     \n        \n        return head;\n    }\n\t};
['Recursion', 'C++']