pieces. Write each one in binary (no leading zeros) and join the three strings in some order. The result is the binary form of a new number.
Return the largest number you can build this way.pieces=[2, 5, 1] → 54
In binary these are "10", "101" and "1". The order 1, 5, 2 gives "110110" = 54, more than any other order.
pieces=[4, 4, 3] → 228
"11" has to go first: "11100100" = 228.
pieces=[1, 1, 1] → 7
len(pieces) = 3pieces[i] ≤ 127pieces=[2, 5, 1]
54
Run checks the first 3 tests in your browser. Submit checks all 93 tests on the server, hidden ones included.