Easy HashMaps with PQ solution in C++✅✅ || O(n) 
Complexity
Time complexity: O(n)

Space complexity: O(n)
Code
# Complexity
- Time complexity: O(n)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(n)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    int maximumSum(vector<int>& nums) {
        map<int, priority_queue<int>> mp;
        int mx = -1, n=nums.size(),T;
        for(int i = 0; i < n; i++){
            int s = 0, x = nums[i];
            while(x){
                s += (x % 10), x /= 10;
            }
            mp[s].push(nums[i]);
        }
        for(auto &it: mp){
            if(it.second.size() > 1){
                T = it.second.top();
                it.second.pop();
                mx = max(mx ,(T + it.second.top()));
             }
        }
        return mx;
    }
};
```
['Hash Table', 'Sorting', 'Heap (Priority Queue)', 'C++']