Problem-98.py 文件源码

python
阅读 42 收藏 0 点赞 0 评论 0

项目:Project-Euler 作者: XiaoTaoWang 项目源码 文件源码
def search(pairs, squares):

    hits = set()
    for Len in pairs:
        candis = pairs[Len]
        spaces = squares[Len]
        for w1, w2 in candis:
            for sqs in spaces:
                numsqs = int(sqs)
                if numsqs in hits:
                    continue
                check = match(w1, sqs)
                if not check:
                    continue
                table = maketrans(w1, sqs)
                trans = w2.translate(table)
                if trans in spaces:
                    hits.add(numsqs)
                    hits.add(int(trans))

    return max(hits)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号