题目描述解题思路 题目描述 解题思路具体参照专题的链表章节。 class Solution { public ListNode getKthFromEnd(ListNode head, int k) { ListNode pre = head; ListNode cur = head; while (k-- > 0) { cur = cur.next; } while (cur != null) { cur = cur.next; pre = pre.next; } return pre; }}