C++ || Map
\nclass Solution {\npublic:\n    int getSum(int n)\n    {\n        int sum = 0;\n        while (n != 0) {\n            sum = sum + n % 10;\n            n = n / 
```\nclass Solution {\npublic:\n    int getSum(int n)\n    {\n        int sum = 0;\n        while (n != 0) {\n            sum = sum + n % 10;\n            n = n / 10;\n        }\n        return sum;\n    }\n    int maximumSum(vector<int>& nums) {\n        unordered_map<int, vector<int>> mp; \n        \n        for (auto num: nums) {\n            int s= getSum(num); \n            mp[s].push_back(num); \n        }\n        int mx=0; \n        vector<int> values; \n        int ans=-1; \n        for (auto m: mp) {\n            // cout<<m.first<<" : ";\n            // for (auto v: m.second) cout<<v<<" "; \n            // cout<<endl;\n            \n            if (m.second.size() > 1) {\n                values= m.second; \n                sort(values.rbegin(), values.rend());\n                ans= max(ans, values[0]+ values[1]); \n            }\n        }\n        \n        return ans;\n        \n    }\n};\n```
['C', 'Sorting']