题解 | #输出单向链表中倒数第k个结点#
输出单向链表中倒数第k个结点
https://www.nowcoder.com/practice/54404a78aec1435a81150f15f899417d
import sys
class Node(object):
def __init__(self, val=0):
self.val = val
self.next = None
while True:
try:
head = Node()
count, num_list, k = int(input()), list(map(int, input().split())), int(input())
while k:
head.next = Node(num_list.pop())
head = head.next
k -= 1
print(head.val)
except EOFError:
break
纯拷贝,链表还需增强

