1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 19:31:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

add leetcode problem-cn part2

This commit is contained in:
2022-03-27 20:38:29 +08:00
parent 5a4fa6db12
commit 0fc7f4b734
1617 changed files with 134637 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<p>Given a list of millions of words, design an algorithm to create the largest possible rectangle of letters such that every row forms a word (reading left to right) and every column forms a word (reading top to bottom). The words need not be chosen consecutively from the list but all rows must be the same length and all columns must be the same height.</p>
<p>If there are more than one answer, return any one of them. A word can be used more than once.</p>
<p><strong>Example 1:</strong></p>
<pre>
<strong>Input:</strong> <code>[&quot;this&quot;, &quot;real&quot;, &quot;hard&quot;, &quot;trh&quot;, &quot;hea&quot;, &quot;iar&quot;, &quot;sld&quot;]</code>
<strong>Output:
</strong><code>[
&nbsp; &quot;this&quot;,
&nbsp; &quot;real&quot;,
&nbsp; &quot;hard&quot;</code>
]</pre>
<p><strong>Example 2:</strong></p>
<pre>
<strong>Input:</strong> <code>[&quot;aa&quot;]</code>
<strong>Output: </strong>[&quot;aa&quot;,&quot;aa&quot;]</pre>
<p><strong>Notes: </strong></p>
<ul>
<li><code>words.length &lt;= 1000</code></li>
<li><code>words[i].length &lt;= 100</code></li>
<li>It&#39;s guaranteed that&nbsp;all the words are randomly generated.</li>
</ul>