题解 | #整型数组合并#

整型数组合并

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

相关推荐

01-24 08:13
已编辑
合肥工业大学 Java
程序员牛肉:没啥问题。标准的流水线简历,但是学历好一点,所以应该是有约面的机会的。 这段时间可以考虑把自己的两个项目彻底的理一理。争取能够讲清楚每一个功能点
点赞 评论 收藏
分享
评论
3
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务