电子表格文件每行包含七个自然数。确定表格行中满足以下条件的最小数字的总和:
- 一行中有两个数字,每个数字重复两次,另外三个数字不同;
- 最大行数不重复。
在你的回答中,只写下数字。
f = open("9")
cnt = 0
for s in f:
a = list(map(int, s.split()))
povt = [x for x in a if a.count(x) > 1]
ne_povt = [x for x in a if a.count(x) == 1]
if (len(ne_povt) == 3 and len(set(povt)) == 2) and max(ne_povt) == 1:
cnt += 1
print(cnt)