题解 | #查找兄弟单词#

查找兄弟单词

http://www.nowcoder.com/practice/03ba8aeeef73400ca7a37a5f3370fe68

while True:
    try:
        words = input().split()
        n = int(words[-1])
        word = words[-2]
        words = words[1:-2]
        ans = []
        for c in words:
            if len(c) != len(word) or c == word or sorted(c) != sorted(word):
                continue
            ans.append(c)
        ans = sorted(ans)
        print(len(ans))
        print(ans[n-1])
    except:
        break
全部评论

相关推荐

notbeentak...:真的nc,算毕业6月份,要给这种b公司打半年多白工😅
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务