题解 | #查找兄弟单词#
查找兄弟单词
https://www.nowcoder.com/practice/03ba8aeeef73400ca7a37a5f3370fe68
while True: try: s = input().split(" ") n = s[0] k = int(s[-1]) x = s[-2] sdli = s[1:-2] sli = [] for i in sdli: tags = 0 if len(x) != len(i) or x == i: continue for j in x: if x.count(j) == i.count(j): pass else: tags = 1 break if tags == 0: sli.append(i) sli.sort() print(len(sli)) print(sli[k-1]) except: break