mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 11:43:12 +08:00 
			
		
		
		
	国外版
This commit is contained in:
		
							
								
								
									
										35
									
								
								算法题(国外版)/maximum-product-of-word-lengths.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								算法题(国外版)/maximum-product-of-word-lengths.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,35 @@
 | 
			
		||||
<p>Given a string array <code>words</code>, return <em>the maximum value of</em> <code>length(word[i]) * length(word[j])</code> <em>where the two words do not share common letters</em>. If no such two words exist, return <code>0</code>.</p>
 | 
			
		||||
 | 
			
		||||
<p> </p>
 | 
			
		||||
<p><strong>Example 1:</strong></p>
 | 
			
		||||
 | 
			
		||||
<pre>
 | 
			
		||||
<strong>Input:</strong> words = ["abcw","baz","foo","bar","xtfn","abcdef"]
 | 
			
		||||
<strong>Output:</strong> 16
 | 
			
		||||
<strong>Explanation:</strong> The two words can be "abcw", "xtfn".
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
<p><strong>Example 2:</strong></p>
 | 
			
		||||
 | 
			
		||||
<pre>
 | 
			
		||||
<strong>Input:</strong> words = ["a","ab","abc","d","cd","bcd","abcd"]
 | 
			
		||||
<strong>Output:</strong> 4
 | 
			
		||||
<strong>Explanation:</strong> The two words can be "ab", "cd".
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
<p><strong>Example 3:</strong></p>
 | 
			
		||||
 | 
			
		||||
<pre>
 | 
			
		||||
<strong>Input:</strong> words = ["a","aa","aaa","aaaa"]
 | 
			
		||||
<strong>Output:</strong> 0
 | 
			
		||||
<strong>Explanation:</strong> No such pair of words.
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
<p> </p>
 | 
			
		||||
<p><strong>Constraints:</strong></p>
 | 
			
		||||
 | 
			
		||||
<ul>
 | 
			
		||||
	<li><code>2 <= words.length <= 1000</code></li>
 | 
			
		||||
	<li><code>1 <= words[i].length <= 1000</code></li>
 | 
			
		||||
	<li><code>words[i]</code> consists only of lowercase English letters.</li>
 | 
			
		||||
</ul>
 | 
			
		||||
		Reference in New Issue
	
	Block a user