1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-12 17:05:15 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
Files
leetcode-problemset/leetcode-cn/problem (Chinese)/单词矩阵 [word-rectangle-lcci].html
2025-09-29 14:43:44 +08:00

29 lines
956 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给定一份单词的清单,设计一个算法,创建由字母组成的面积最大的矩形,其中每一行组成一个单词(自左向右),每一列也组成一个单词(自上而下)。不要求这些单词在清单里连续出现,但要求所有行等长,所有列等高。</p>
<p>如果有多个面积最大的矩形,输出任意一个均可。一个单词可以重复使用。</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong><code>["this", "real", "hard", "trh", "hea", "iar", "sld"]</code>
<strong>输出:
</strong><code>[
&nbsp; "this",
&nbsp; "real",
&nbsp; "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 &lt;= 1000</code></li>
<li><code>words[i].length &lt;= 100</code></li>
<li>数据保证单词足够随机</li>
</ul>