/**
* Definition for singly-linked list.
* public class ListNode {
* public int val;
* public ListNode next;
* public ListNode(int x) { val = x; }
* }
*/
public class Solution
{
public ListNode GetKthFromEnd(ListNode head, int k)
{
ListNode res = head;
int index = 1;
while(true)
{
head = head.next;
if(index > k)
res = res.next;
index++;
if(head == null)
return res;
}
}
}