题解 | #查找兄弟单词#
查找兄弟单词
http://www.nowcoder.com/practice/03ba8aeeef73400ca7a37a5f3370fe68
while True:
try:
data = input().split()
num = int(data[0])
data.pop(0)
check_word = data[-2]
data.pop(-2)
bro_word_print_index = int(data[-1])
data.pop(-1)
bro_num = 0
bro_word = []
for word in data:
if check_word == word:
continue
elif sorted(word) == sorted(check_word):
bro_num +=1
bro_word.append(word)
print(bro_num)
bro_word.sort()
print(bro_word[bro_word_print_index-1])
except:
break