C++ | 3 lines | 3 methods | 0 bishes
The two minimum digits should be the tenths places of our two digit numbers\n    Eg : 3425 -> minDigit1 = 2\n                 minDigit2 = 3\n    res = 25+34 OR 
### The two minimum digits should be the tenths places of our two digit numbers\n    Eg : 3425 -> minDigit1 = 2\n                 minDigit2 = 3\n    res = 25+34 OR 24+35\n### Method1 : string\n```c++\nint minimumSum(int n) {\n    string s = to_string(n);\n    sort(s.begin(), s.end());\n    return (s[0]-\'0\' + s[1]-\'0\') * 10 + s[2]-\'0\' + s[3]-\'0\';\n```\n### Method2 : array\n```c++\nint minimumSum(int n) {\n    int arr[4] = {n%10,n/10%10,n/100%10,n/1000%10};\n    sort(begin(arr),end(arr));\n    return arr[0]*10 + arr[1]*10 + arr[2] + arr[3];\n```\n### Method3: Brainless (\u02F5 \u0361\xB0 \u035C\u0296 \u0361\xB0\u02F5)\n```c++\nint minimumSum(int n) {\n    short n1 = n%10;\n    short n2 = n/10%10;\n    short n3 = n/100%10;\n    short n4 = n/1000%10;\n\n    short ans1 = n1*10+n2*10+n3+n4;\n    short ans2 = n1*10+n3*10+n2+n4;\n    short ans3 = n1*10+n4*10+n2+n3;\n    short ans4 = n2*10+n3*10+n1+n4;\n    short ans5 = n2*10+n4*10+n1+n3;\n    short ans6 = n3*10+n4*10+n1+n2;\n\n    return min(ans1,min(ans2,min(ans3,min(ans4,min(ans5,ans6)))));\n\n```
['C++']