题解 | #整型数组合并#

整型数组合并

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

n = int(input())
a1 = list(map(int, input().split(" ")))

m = int(input())
a2 = list(map(int, input().split(" ")))

# 先过滤重复元素
ans = []
for num in a1 + a2:
    if num not in ans:
        ans.append(num)

# 排序后按规定输出
s = ""
for num in sorted(ans):
    s += str(num)
print(s)

全部评论

相关推荐

06-11 17:39
门头沟学院 Java
小呆呆的大鼻涕:卧槽,用户彻底怒了
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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