Here is my solution in C (one pass , 2 pointers) with comments
struct ListNode* removeNthFromEnd(struct ListNode* head, int n) {\n    struct ListNode* HEAD1;\n    struct ListNode* HEAD2;\n    HEAD1=head;\n    HEAD2=head;\n 
    struct ListNode* removeNthFromEnd(struct ListNode* head, int n) {\n    struct ListNode* HEAD1;\n    struct ListNode* HEAD2;\n    HEAD1=head;\n    HEAD2=head;\n    for(int i=0;i<n;i++) //take pointer HEAD1 n places ahead of HEAD2\n    {   \n        HEAD1=HEAD1->next;\n        if(!HEAD1)          // when we have to delete the first node\n        return head->next;\n    }  \n    while(HEAD1->next)   //take HEAD1 to last node so that HEAD2 is 1 behind the node we want to delete\n    {   \n        HEAD2=HEAD2->next;\n        HEAD1=HEAD1->next;\n        \n    }\n    HEAD2->next=HEAD2->next->next; // delete the node next to HEAD2\n    \n    \n    return head;\n    \n}
[]