1 ms, 41mb, Java, Sorting
https://leetcode.com/problems/minimum-sum-of-four-digit-number-after-splitting-digits/submissions/\nThe logic is: take the 4 digit numbers and split the digits 
https://leetcode.com/problems/minimum-sum-of-four-digit-number-after-splitting-digits/submissions/\nThe logic is: take the 4 digit numbers and split the digits and store in an array of size 4. Then sort the array. Objective is to make two numbers that are smallest (so that their sum is smallest). One way of doing this is by take 0th and 1st elements as the first number and 3rd and 4th elements as the second number.\n2932\nSorted 2239\nNumber 1: 22\nNumber 2: 39\nSum: 61\nOther way is 1st element as the 10s position and 3rd element as the ones position\nAnd 2nd digit as 10s position and 4th digit as ones position.\nNumber 1: 23\nNumber 2: 29\nSum: 51\nReturn 51;\n\nSo second approach  is the answer.\n```\nclass Solution{\n    public int minimumSum(int num){\n        int[] temp = new int[4];\n        int i = 0;\n        while(num>0){\n            temp[i]=num%10;\n            i++;\n            num=num/10;\n        }\n        //now we have an array temp with all the digits of the num, we will sort temp\n        Arrays.sort(temp);\n        int num1 = temp[0]*10 + temp[2];\n        int num2 = temp[1]*10 + temp[3];\n        return (num1+num2);\n    }\n}\n```\n
['Sorting', 'Java']