Skip to content

Commit b0afca1

Browse files
committed
Create README - LeetHub
1 parent 7b523ba commit b0afca1

File tree

1 file changed

+50
-0
lines changed
  • 3403-find-the-lexicographically-largest-string-from-the-box-i

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<h2><a href="https://leetcode.com/problems/find-the-lexicographically-largest-string-from-the-box-i/?envType=daily-question&envId=2025-06-04">3403. Find the Lexicographically Largest String From the Box I</a></h2><h3>Medium</h3><hr><p>You are given a string <code>word</code>, and an integer <code>numFriends</code>.</p>
2+
3+
<p>Alice is organizing a game for her <code>numFriends</code> friends. There are multiple rounds in the game, where in each round:</p>
4+
5+
<ul>
6+
<li><code>word</code> is split into <code>numFriends</code> <strong>non-empty</strong> strings, such that no previous round has had the <strong>exact</strong> same split.</li>
7+
<li>All the split words are put into a box.</li>
8+
</ul>
9+
10+
<p>Find the <span data-keyword="lexicographically-smaller-string">lexicographically largest</span> string from the box after all the rounds are finished.</p>
11+
12+
<p>&nbsp;</p>
13+
<p><strong class="example">Example 1:</strong></p>
14+
15+
<div class="example-block">
16+
<p><strong>Input:</strong> <span class="example-io">word = &quot;dbca&quot;, numFriends = 2</span></p>
17+
18+
<p><strong>Output:</strong> <span class="example-io">&quot;dbc&quot;</span></p>
19+
20+
<p><strong>Explanation:</strong>&nbsp;</p>
21+
22+
<p>All possible splits are:</p>
23+
24+
<ul>
25+
<li><code>&quot;d&quot;</code> and <code>&quot;bca&quot;</code>.</li>
26+
<li><code>&quot;db&quot;</code> and <code>&quot;ca&quot;</code>.</li>
27+
<li><code>&quot;dbc&quot;</code> and <code>&quot;a&quot;</code>.</li>
28+
</ul>
29+
</div>
30+
31+
<p><strong class="example">Example 2:</strong></p>
32+
33+
<div class="example-block">
34+
<p><strong>Input:</strong> <span class="example-io">word = &quot;gggg&quot;, numFriends = 4</span></p>
35+
36+
<p><strong>Output:</strong> <span class="example-io">&quot;g&quot;</span></p>
37+
38+
<p><strong>Explanation:</strong>&nbsp;</p>
39+
40+
<p>The only possible split is: <code>&quot;g&quot;</code>, <code>&quot;g&quot;</code>, <code>&quot;g&quot;</code>, and <code>&quot;g&quot;</code>.</p>
41+
</div>
42+
43+
<p>&nbsp;</p>
44+
<p><strong>Constraints:</strong></p>
45+
46+
<ul>
47+
<li><code>1 &lt;= word.length &lt;= 5&nbsp;* 10<sup>3</sup></code></li>
48+
<li><code>word</code> consists only of lowercase English letters.</li>
49+
<li><code>1 &lt;= numFriends &lt;= word.length</code></li>
50+
</ul>

0 commit comments

Comments
 (0)