题解 | #HJ48 从单向链表中删除指定值的节点#

从单向链表中删除指定值的节点

http://www.nowcoder.com/practice/f96cd47e812842269058d483a11ced4f

python3

while True:
    try:
        n,head,*tail,rm = input().split()
        res = [head]
        for i,j in zip(tail[1::2],tail[::2]):
            if i in res:
                res.insert(res.index(i)+1,j)
        res.remove(rm)
        print(' '.join(res))
    except:
        break
全部评论

相关推荐

asdasdasda...:19岁,不容易啊可能升个本会好点,现在学历歧视太严重了
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务