题解 | #查找兄弟单词#
查找兄弟单词
http://www.nowcoder.com/practice/03ba8aeeef73400ca7a37a5f3370fe68
# -*-coding:utf-8-*-
while True:
try:
str_ = input().split(" ")
str_num = int(str_[0])
str_list=[]
for i in range(1,str_num+1):
str_list.append(str_[i])
s_n=0
s_n_list =[]
m_str = str_[-2]
m_str_num = int(str_[-1])
for s_l in str_list:
if len(m_str) == len(s_l):
if(s_l != m_str) and (sorted(s_l) == sorted(m_str) ):
s_n_list.append(s_l)
s_n+=1
print(s_n)
s_n_list.sort()
print(s_n_list[m_str_num-1])
except:
break