pieces. Write their decimal forms one after another, with no separators, in some order, so that they form one long number. Each piece is used exactly once.
Choose the order that makes the resulting number as large as possible and return it as a string (it may not fit in any integer type). The answer must have no leading zeros: if the number is zero, return "0".pieces=[5, 51, 56] → '56551'
56551 beats 55651 and 51556, so the order is 56, then 5, then 51.
pieces=[0, 0, 0] → '0'
Gluing only zeros gives the number 0; no leading zeros are written.
pieces=[12, 121] → '12121'
12121 is larger than 12112, so 12 goes first.
pieces=[5, 51, 56]
'56551'
Run checks the first 3 tests in your browser. Submit checks all 151 tests on the server, hidden ones included.