题解 | #查找兄弟单词#
查找兄弟单词
https://www.nowcoder.com/practice/03ba8aeeef73400ca7a37a5f3370fe68
import sys for line in sys.stdin: a = line.split(" ") num,k,word,restlt1 = int(a[0]),int(a[-1]),a[-2],[] a1 = a[1:-2] for e in range(num): if a1[e] != word and sorted(a1[e]) == sorted(word): restlt1.append(a1[e]) restlt1.sort() if k < len(restlt1): print(len(restlt1)) print(restlt1[k-1]) else: print(len(restlt1))