题目:

题解:
class Solution:
def maxProduct(self, words: List[str]) -> int:
masks = defaultdict(int)
for word in words:
mask = reduce(lambda a, b: a | (1 << (ord(b) - ord('a'))), word, 0)
masks[mask] = max(masks[mask], len(word))
return max((masks[x] * masks[y] for x, y in product(masks, repeat=2) if x & y == 0), default=0)



![[Git][基本操作]详细讲解](https://i-blog.csdnimg.cn/direct/93aeffa7f0124473a1c90a0b8c12f73b.png)







![[E二叉树] lc572. 另一棵树的子树(dfs+前中序判断+树哈希+树上KMP+好题)](https://i-blog.csdnimg.cn/direct/d7b7510090d7462e9fcd4195479f4e65.png)







