题解 | #从单向链表中删除指定值的节点#
从单向链表中删除指定值的节点
https://www.nowcoder.com/practice/f96cd47e812842269058d483a11ced4f
total = list(map(int, input().strip().split())) delete = total[-1] result = [total[1]] total = total[2:-1] for i in range(0, len(total), 2): result.insert(result.index(total[i+1])+1, total[i]) for i in result: if i == delete: result.remove(i) print(*result)