题解 | #从单向链表中删除指定值的节点#
从单向链表中删除指定值的节点
https://www.nowcoder.com/practice/f96cd47e812842269058d483a11ced4f
inData = input().split() linkedList = [inData[1]] for i in range(2, int(inData[0])*2, 2): n = inData[i] t = inData[i+1] l = linkedList.index(t) linkedList.insert(l+1, n) linkedList.remove(inData[-1]) print(" ".join(linkedList))