mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-13 19:31:42 +08:00
add leetcode problem-cn part2
This commit is contained in:
26
算法题(国内版)/problem (Chinese)/单词矩阵 [word-rectangle-lcci].html
Normal file
26
算法题(国内版)/problem (Chinese)/单词矩阵 [word-rectangle-lcci].html
Normal file
@@ -0,0 +1,26 @@
|
||||
<p>给定一份单词的清单,设计一个算法,创建由字母组成的面积最大的矩形,其中每一行组成一个单词(自左向右),每一列也组成一个单词(自上而下)。不要求这些单词在清单里连续出现,但要求所有行等长,所有列等高。</p>
|
||||
|
||||
<p>如果有多个面积最大的矩形,输出任意一个均可。一个单词可以重复使用。</p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong> <code>["this", "real", "hard", "trh", "hea", "iar", "sld"]</code>
|
||||
<strong>输出:
|
||||
</strong><code>[
|
||||
"this",
|
||||
"real",
|
||||
"hard"</code>
|
||||
]</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong> <code>["aa"]</code>
|
||||
<strong>输出: </strong>["aa","aa"]</pre>
|
||||
|
||||
<p><strong>说明:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>words.length <= 1000</code></li>
|
||||
<li><code>words[i].length <= 100</code></li>
|
||||
<li>数据保证单词足够随机</li>
|
||||
</ul>
|
Reference in New Issue
Block a user