题解 | #从单向链表中删除指定值的节点#
从单向链表中删除指定值的节点
https://www.nowcoder.com/practice/f96cd47e812842269058d483a11ced4f
while True:
try:
lst = list(map(int, input().split()))
linklist = [lst[1]]
for i in range(2, len(lst) - 1, 2):
index = linklist.index(lst[i + 1])
linklist.insert(index + 1, lst[i])
linklist.remove(lst[-1])
for item in linklist:
print(item, end=" ")
except:
break