题解 | #整型数组合并#

整型数组合并

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-23 11:43
门头沟学院 Java
allin校招的烤冷...:我靠,今天中午我也是这个hr隔一个星期发消息给我。问的问题还是一模一样的😅
点赞 评论 收藏
分享
不亏是提前批,神仙打架,鼠鼠不配了
站队站对牛:现在92都报工艺岗了
投递韶音科技等公司7个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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