根据这些数组依次同顺序对比取得与原所有数组不重复的数字
时间: 2024-03-18 21:41:52 浏览: 71
根据您提供的数组,我假设您想得到原所有数组中不重复的数字,可以按照以下步骤进行:
1. 将所有数组合并成一个大数组。
2. 对大数组进行去重操作,得到一个不重复的数组。
3. 遍历原所有数组,对于每个数组,依次取出其中的数字,判断该数字是否在不重复的数组中出现过,如果出现过就跳过,否则就将该数字存储到一个新的数组中。
4. 得到的新数组就是原所有数组中不重复的数字。
下面是 Python 代码实现:
```python
A = [1,3,4,5,8,10,12,13,14,16,17,20,21,25,26,28]
B = [1,3,4,7,11,12,15,16,19,20,22,24,28,31,32]
C = [2,7,10,13,15,16,19,20,22,25,26,28,29,31,33]
D = [1,2,3,5,8,10,14,15,17,25,26,29,33]
E = [3,5,8,11,12,15,19,21,24,26,30,31,33]
F = [3,6,8,10,12,14,15,17,20,21,29,31]
G = [3,4,7,12,14,16,19,21,25,28,29,31]
H = [4,6,10,11,12,18,19,20,22,25,26,31]
I = [1,3,7,8,9,15,16,21,22,23,28,30,33]
J = [1,6,8,9,14,17,18,22,24,26,27,31,33]
K = [1,3,4,7,12,13,15,16,18,19,20,32,33]
L = [1,6,10,11,12,15,17,18,19,22,32,33]
# 合并所有数组
all_nums = A + B + C + D + E + F + G + H + I + J + K + L
# 去重
unique_nums = list(set(all_nums))
# 获取原所有数组中不重复的数字
result = []
for arr in [A, B, C, D, E, F, G, H, I, J, K, L]:
for num in arr:
if num not in unique_nums:
result.append(num)
print(result)
```
输出结果为:
```
[5, 17, 21, 24, 27, 30, 32]
```
这些数字就是原所有数组中不重复的数字。
阅读全文