题解 | #查找兄弟单词#
查找兄弟单词
https://www.nowcoder.com/practice/03ba8aeeef73400ca7a37a5f3370fe68
arr = input() arr_list = arr.split() target_lst = arr_list[1 : int(arr_list[0]) + 1] srt_lst = sorted([i for i in arr_list[-2]]) n = 0 bro_lst = [] while n < len(target_lst): if srt_lst == sorted([i for i in target_lst[n]]) and arr_list[-2] != target_lst[n]: bro_lst.append(target_lst[n]) n += 1 else: n += 1 bro_lst.sort() print(len(bro_lst)) if int(arr_list[-1]) < len(bro_lst): print(bro_lst[int(arr_list[-1]) - 1])