题解 | #序列找数#
序列找数
https://www.nowcoder.com/practice/a7d1856a72404ea69fdfb5786d65539c
根据题意给出的一组整数中找出没有出现在小于等于n的非负整数
对于python语言来说,掌握list,map函数、for循环遍历判断一下是否在列表里即可
AC源代码
s = list(map(int,input().split())) n = s[0] s.pop(0) for i in range(n+1): if i not in s: print(i, end=" ")