C++ || 0ms || Easy Solution
Here, what we do first is to seperate all the digits in the number, and store them in an array of size 4.\nTo do this we take the modulo of the number with 10 t
Here, what we do first is to seperate all the digits in the number, and store them in an array of size 4.\nTo do this we take the modulo of the number with 10 to get the last digit, and then divide the number by 10, and run the loop again to get the next digit.\n\nNow we will sort the array to arrange all the digits obtained in an non-decreasing order.\n\nAfter sorting the digits, we have to make 2, 2 digit numbers, as we know if we make a 3 digit number and a one digit number, it\'s sum will always be more than that of sum of 2, 2 digit numbers.\nSince we want the minimum possible sum, the 10s place digits of those 2 numbers must be minimum.\nSo the first 2 elements of our sorted array are the 10s digit of our number and the reamaining 2 elements are the ones digit. Combination of 10s place digit with Ones place digit doesn\'t matter here, as both will give exact same sum.\n\n```\nclass Solution {\npublic:\n    int minimumSum(int num) {\n        int arr[4];  //  Declaring an Array of size 4\n        for(int i =0; i<4; i++) // Running a loop to fill array with digits of num\n        {\n            arr[i] = num%10; // Taking the last digit and inserting it in the array\n            num /= 10;\n        }\n        sort(arr, arr + 4); // Sorting the array\n\t\t// Returning the sum of 2 numbers.\n        return (arr[0]*10 + arr[2] + arr[1]*10 + arr[3]);\n    }\n};\n```
['C', 'Sorting', 'C++']