题解 | #整型数组合并#

整型数组合并

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

while True:
    try:
        a = input()
        b = map(int,input().split())
        c = input()
        d = map(int,input().split())
        e = []
        #找到不重复的元素,放入空数组
        for i in b:
            if i not in e:
                e.append(i)
        for i in d:
            if i not in e:
                e.append(i)
        #升序排列,无连接符        
        print(''.join(map(str,sorted(e)))) 
        
        
    except:
        break
全部评论
用map吧,不用查重复
点赞 回复 分享
发布于 2022-05-27 10:51

相关推荐

牛客鼠:校友你这简历基本无敌了,春招刷刷题去冲大厂
点赞 评论 收藏
分享
昨天 00:16
已编辑
湖北大学 Java
Java抽象带篮子:java简历怎么写可以看看我发的帖子,很详细的
点赞 评论 收藏
分享
评论
3
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务