题解 | #查找兄弟单词#
查找兄弟单词
https://www.nowcoder.com/practice/03ba8aeeef73400ca7a37a5f3370fe68
import sys
from collections import Counter
while True:
try:
b = list(input().split())
n, target, st, num = int(b[0]), b[-2], b[1:-2], int(b[-1])
ans = []
for i in st:
if len(i) > len(target) or len(i) < len(target):
continue
if i != target and Counter(i) == Counter(target) :
ans.append(i)
print(len(ans))
ans = sorted(ans)
if ans[num-1]:
print(ans[num-1])
except:
break

