code. Distribute its four digits into two new numbers: every digit is used exactly once, digits inside a new number may go in any order, and leading zeros are allowed (05 is simply 5). The two new numbers may have different lengths.
For instance, 2932 can become 22 and 93, 223 and 9, or 2 and 329.
Return the smallest possible sum of the two new numbers.code=3715 → 52
For example 13 + 57 = 70, while 15 + 37 = 52 (as does 17 + 35). Nothing below 52 is possible, since the two smallest digits 1 and 3 sit in the tens places.
code=6002 → 8
Zeros are best used as leading digits: 02 + 06 = 2 + 6 = 8.
code=3715
52
Run checks the first 3 tests in your browser. Submit checks all 85 tests on the server, hidden ones included.