题解 | #查找兄弟单词#
查找兄弟单词
https://www.nowcoder.com/practice/03ba8aeeef73400ca7a37a5f3370fe68
count = 0 ls = [] res = '' str = input().split() head_num = str.pop(0) k = int(str.pop()) x = str.pop() for s in str: if s != x and (sorted(s)) == (sorted(x)): ls.append(s) count += 1 if count == int(k): res = s if count >= k: res = sorted(ls)[k - 1] print(count) print(res)