Loading...
Loading...
Loading...
A lock code is made by writing several non-negative whole numbers one after another in any order. Print the largest number that can be made. If every piece is 0, print 0.
Example 1
Input
3 30 34 5 9
Output
9534330
Example 2
Input
0 0 0
Output
0
Try the problem first. Open one hint at a time.
Compare two pieces a and b by which of a+b and b+a is bigger, as text.
Use functools.cmp_to_key for a custom order.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor