/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* findKthToTail(ListNode* pListHead, int k) {
int len=0;
ListNode* p=pListHead;
while(p){len++;p=p->next;}
if(k>len)return NULL;
else
{
int cnt=len-k+1;
ListNode* p1=pListHead;
for(int i=1;i<=cnt-1;i++)p1=p1->next;
return p1;
}
}
};