题解 | #从单向链表中删除指定值的节点#
从单向链表中删除指定值的节点
https://www.nowcoder.com/practice/f96cd47e812842269058d483a11ced4f
s = input().split() N = int(s[0]) ls =[] ls.append(s[1]) for i in range(1,N): v = s[2*i] pre = s[2*i + 1] ls.insert(ls.index(pre) + 1,v) ls.remove(s[-1]) for k in ls: print(k,end=' ')