Loading
Loading
A conference prints one long badge number for its anniversary by laying out the stickers it has collected, each showing a non-negative whole number, side by side in some order. Every sticker must be used exactly once, and stickers cannot be cut or flipped.
Return, as a string, the largest number that can be formed. The answer must not have leading zeros: if it would be all zeros, return "0".
stickers = [3, 30, 34, 5, 9]9 before 595 > 5934 before 3343 > 3343 before 30330 > 3039 5 34 3 30joined: 9534330"9534330"Sign in to keep a note here. It is free, and nobody else can see it.
Sign inExample 1
2 before 10, since 210 > 102.
Example 2
Sign in to open hints.
Struggling is where the learning happens. Open this once you have genuinely tried, or once the hints have run out.
O(n log n) time · O(n) space
Input. Run your code to watch it work on this input, one line at a time.
Running code is turned off on this deployment. You can still read the problem, write code, use hints and the visualizer.
Tab moves focus out of the editor. Press Ctrl+M to let Tab indent instead.
No results yet
Run your code against the sample tests, or submit to run the full suite.
9, 5, 34, 3, 30.