C++ EASY SOLUTION using the concept of VECTOR PAIR
\nint maximumSum(vector<int>& v) {\n        int n=v.size(),i;\n        int ans=-1;\n        vector<pair<int,int>>x;\n        for(i=0;i<n;i++){\n            int 
```\nint maximumSum(vector<int>& v) {\n        int n=v.size(),i;\n        int ans=-1;\n        vector<pair<int,int>>x;\n        for(i=0;i<n;i++){\n            int y = v[i];\n            int z=0;\n            while(y){\n                z+=y%10;\n                y/=10;\n            }\n            x.push_back(make_pair(z,v[i]));\n        }\n        sort(x.begin(),x.end());\n        for(i=0;i<n-1;i++){\n            int z =x[i].second+x[i+1].second;\n            if(x[i].first==x[i+1].first){\n                ans=max(ans,z);\n            }\n        }\n        return ans;\n    }\n\t```
['C', 'C++']