solution in java
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nto make min sum, the 1st elements of both num1 and num2 should be either 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nto make min sum, the 1st elements of both num1 and num2 should be either arr[0] or arr[1] after sorting the arr, or we can say the the min elements.\n\nin the code we have converted int to array. now in the array the int is stored as char( ASIC). so suppose you want to access 1st element of array or store it, you need to substract 0. arr[0]-\'0\' to convert it from char to int. if you do arr[0], it will be a char not an int. ex:- 1152 converted to array, in the array it wont be [ 1 1 5 2] but something else.\n\nso we have 2 halves sum1 and sum2. we know 1st and 2nd elements of arr will be the 1st elements of both sum. so we do sum1= num1*10 +num2, we multiply with 10 because we need a 2 digit number.\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int minimumSum(int num) {\n        char[] arr= String.valueOf(num).toCharArray();\n/* to make min sum, the 1st elements of both num1 and num2 should be either arr[0] or arr[1] after sorting the arr, or we can say the the min elements. */\n        Arrays.sort(arr);\n\n        int num1 = (arr[0]-\'0\');\n        int num2 = (arr[3]-\'0\');\n        int num3= (arr[1]-\'0\');\n        int num4 = (arr[2]-\'0\');\n\n        int sum1= num1*10 + num2;\n        int sum2= num3*10+ num4;\nint finalsum = sum1+sum2;\n        return finalsum;\n    }\n}\n```
['Java']