Given a positive integer
num, split it into two non-negative integers
num2 such that:
num2is a permutation of
num2is equal to the number of occurrences of that digit in
num2can contain leading zeros.
Return the minimum possible sum of
numdoes not contain any leading zeros.
num2may differ from the order of occurrence of
Input: num = 4325 Output: 59 Explanation: We can split 4325 so that
num1is 24 and num2
is35, giving a sum of 59. We can prove that 59 is indeed the minimal possible sum.
Input: num = 687 Output: 75 Explanation: We can split 687 so that
num1is 68 and
num2is 7, which would give an optimal sum of 75.
10 <= num <= 109