题解 | #整型数组合并#

整型数组合并

https://www.nowcoder.com/practice/c4f11ea2c886429faf91decfaf6a310b

def fun():
    a = int(input())
    b, *args = map(int, input().split())
    list1 = [b, *args]
    if a != len(list1):
        raise Exception("报错")
    c = int(input())
    d, *args = map(int, input().split())
    list2 = [d, *args]
    if c != len(list2):
        raise Exception("报错")
    list3 = list1 + list2
    list4 = []
    for i in list3:
        if i not in list4:
            list4.append(i)
    list4.sort()
    for i in list4:
        print(i,end="")


if __name__ == "__main__":
    try:
        fun()
    except Exception as ee:
        print("报错{}".format(ee))

全部评论

相关推荐

06-02 15:17
门头沟学院 Java
心爱的idea:怎么会呢 应该是打招呼有问题 问就说实习6个月全国可飞随时到岗
点赞 评论 收藏
分享
仁者伍敌:难怪小公司那么挑剔,让你们这些大佬把位置拿了
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-10 12:10
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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