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