class Solution {
public:
/**
* @param head: The first node of linked list.
* @param n: An integer.
* @return: Nth to last node of a singly linked list.
*/
ListNode *nthToLast(ListNode *head, int n) {
ListNode *xx,*uu;
int l=0;
xx=head;
uu=head;
while(head!=NULL)
{
l++;
head=head->next;
}
for(int i=1;i<l-n+1;i++)
{
xx=xx->next;
}
return xx;
// write your code here
}
};