ListNode* removeNthFromEnd(ListNode* head, int n) {
ListNode*l1=head;
int c=0;
while(l1!=NULL)
{
c+=1;
l1=l1->next;
}
if(c==n)return head->next;
if(c<n)return NULL;
ListNode*l2=head;
for(int i=1;i<c-n;i++){
l2=l2->next;
}
ListNode *l3=l2->next;
l2->next=l3->next;
return head;
}