# bitmaskclassSolution:defmaxProduct(self,words: List[str]) ->int: num_words =len(words)# Create a list to store the bitmask representation of each word masks = [0] * num_words# Generate a bitmask for each word where bit i is set if the # word contains the i-th letter of the alphabet: [4194311, 33554435, 16416, 131075, 8921120, 63]for i, word inenumerate(words):for ch in word: masks[i]|=1<< (ord(ch)-ord('a')) max_product =0for i inrange(num_words -1):for j inrange(i +1, num_words):if masks[i]& masks[j]==0: max_product =max(max_product, len(words[i]) *len(words[j]))return max_product