 || ✅✅Optimal Approach  &&  #Day_25th_Of_Daily_Coding🙏🙏 ||
JAI SHREE DATNA🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏Code
# JAI SHREE DATNA🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏
![image.png](https://assets.leetcode.com/users/images/a83f502b-3cc5-49b1-a0ba-cb0458ed8fec_1739359463.6165676.png)


# Code
```cpp []
class Solution {
public:
    int maximumSum(vector<int>& nums) {
        unordered_map<int,int>mp;
        int ans = -1;
        for(auto & it : nums){
            int curr = 0, x = it;
            while(x){
                curr += x%10;
                x /= 10;
            }
            if(mp[curr] != 0) ans = max(ans, it + mp[curr]);
            mp[curr] = max(mp[curr], it);
        }
        return ans;
    }
};
```
['Array', 'Hash Table', 'Sorting', 'Heap (Priority Queue)', 'C++']