#3403
Find the Lexicographically Largest String From the Box I
expert · 1020 · lc medium +32 · 41% accepted · 487 likes · top 21%
Description
You are given a string word and an integer numFriends.
Alice runs a multi-round game where each round word is split into numFriends non-empty substrings, using a split configuration not used in any previous round. All split pieces go into a box.
Find the lexicographically largest string that can appear in the box across all possible rounds.
Code
1
2
3