simple and easy C++ solution || HashTable + maxHeap
\n# if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n###### Let\'s Connect on Linkedin: www.linkedin.com/in/shishirrsiam\n\n\n# Code\ncpp []\nclass Solution 
\n# if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n###### Let\'s Connect on Linkedin: www.linkedin.com/in/shishirrsiam\n\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int maximumSum(vector<int>& nums) \n    {\n        string s;\n        long sum, ans = 0;\n        unordered_map<int, priority_queue<int>>store;\n        for(auto val:nums)\n        {\n            sum = 0;\n            s = to_string(val);\n            for(auto ch:s) sum += ch - \'0\';\n            store[sum].push(val);\n        }\n\n        for(auto [sumCount, pq]:store)\n        {\n            if(pq.size() == 1) continue;\n            sum = pq.top(); pq.pop();\n            sum += pq.top();\n            ans = max(ans, sum);\n        }\n        return ans ? ans : -1;\n    }\n};\n```
['Array', 'Hash Table', 'Sorting', 'Heap (Priority Queue)', 'C++']