题解 | #查找兄弟单词#
查找兄弟单词
https://www.nowcoder.com/practice/03ba8aeeef73400ca7a37a5f3370fe68
while True: try: inputList = input().split() broList = [] broStr = inputList[-2] outIndex = int(inputList[-1]) cutList = inputList[1:len(inputList)-2] for i in cutList: if len(i) == len(broStr): if i != broStr: if ''.join(sorted(i)) == ''.join(sorted(broStr)): broList.append(i) broList.sort() print(len(broList)) if outIndex <= len(broList): print(broList[outIndex-1]) except: break