Maximum Product of Word Lengths

Given a string array words, return the maximum product of the lengths of two words that do not share any common letters. If no such pair of words exists, return 0.

Constraints

  • 2 <= words.length <= 1000
  • 1 <= words[i].length <= 1000
  • words[i] consists only of lowercase English letters.
Saving… · 2 lines
class Solution:
def maximumProductOfWordLengths(self, words: List[str]) -> int:
Console

Click Run to execute sample tests.