核心:就挺难说的,暴力求解吧
代码:
def func(l): c = [] l1 = [0] * len(l) res = [] for i in range(len(l)): x = l[i] t = [0] * 10 while x != 0: tem = x % 10 t[tem] += 1 x //= 10 c.append(t) for j in range(len(c)-1): ten = c[-1:] tem1 = c[j:j+1] if c[j:j+1] == c[-1:]: l1[j], l1[len(c)-1] = 1, 1 for i in range(len(l)): if l1[i] != 1: res.append(l[i]) return res while True: n = int(input()) if n == 0: break l = [int(x) for x in input().split()] l.sort() res = func(l) if res != []: for x in res: print(x, end=' ') print() else: print('None')
0.0分
0 人评分