题解 | #查找兄弟单词#
查找兄弟单词
https://www.nowcoder.com/practice/03ba8aeeef73400ca7a37a5f3370fe68
import itertools
lis = input().split()lis1 = []
for i in [i for i in itertools.permutations(lis[-2])]:
lis1.append("".join(i))
for k in range(lis1.count(lis[-2])):
lis1.remove(lis[-2])
lis2=[j for j in lis[1:(int(lis[0])+1)] if j in lis1 ]
lis2.sort()
print(len(lis2))
if int(lis[-1])-1<len(lis2):
print(lis2[int(lis[-1])-1])
#查找兄弟单词#