Logo
IconChallenge
Icon
IconProblem
IconSolutions
IconSubmissions

Maximum Product of Word Lengths

XPChallenge Points: 20
levelLevel: Medium

You are given an array of strings words.
Your task is to find the maximum product of the lengths of two words that do not share any common letters.

If no such pair exists, return 0.

Example 1:

Input: words = ["lamp","quiz","book","flow","dry","pen"]

Output: 16

Example 2:

Input: words = ["hi","world","data","code","key"]

Output: 12

to Continue
like
dislike

Accepted:

Submission:

IconReport an issue
Icon
IconCode
IconYou need toto run or submitYou need toto run or submit
IconTest Case
IconTest Result