public ListNode getKthFromEnd(ListNode head, int k) { ListNode slow=head; ListNode fast=head; int t = 0; for(;fast!=null;){ if(t>=k) { slow=slow.next; } fast = fast.next; t++; } return slow; }