C++ 4 lines just sort and one swap
\nclass Solution {\npublic:\n    int minimumSum(int num) {\n        string x = to_string(num);\n        sort(x.begin(), x.end());\n        swap(x[2], x[1]);\n  
```\nclass Solution {\npublic:\n    int minimumSum(int num) {\n        string x = to_string(num);\n        sort(x.begin(), x.end());\n        swap(x[2], x[1]);\n        return stoi(x.substr(0, 2)) + stoi(x.substr(2, 2));\n    }\n};\n```
[]