number. Distribute all of its digits between two non-negative integers: every digit of number must go into exactly one of them (as many times as it occurs), and the digits inside each integer may be arranged in any order. Leading zeros are allowed.
Return the smallest possible sum of the two integers.number=5132 → 38
For example 13 and 25, which add up to 38. Nothing smaller is possible.
number=900 → 9
The numbers 0 and 09 = 9 use the digits 9, 0, 0, for a sum of 9.
number=73 → 10
number=5132
38
Run checks the first 3 tests in your browser. Submit checks all 76 tests on the server, hidden ones included.