题解 | #查找兄弟单词#
查找兄弟单词
https://www.nowcoder.com/practice/03ba8aeeef73400ca7a37a5f3370fe68
def solution(x,k,strs): c = sorted(x) tmp = [] for s in strs: if sorted(s) == c and s!=x: tmp.append(s) tmp = sorted(tmp) m = len(tmp) print(m) if k <= m: print(tmp[k-1]) while True: try: strs = input().split() x,k = strs[-2], int(strs[-1]) solution(x,k,strs[1:-2]) except: break