/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* findKthToTail(ListNode* head, int k) {
auto *q = head;
int count = 0;
for(auto p = head;p;p = p->next)
if(count < k) count++;
else q = q->next;
if(count < k) return nullptr;
else return q;
}
};