Two Sum
Similarly to 1. Two Sum, we use hash map to match pairs.\n                     \nInstead of a compliment, we use the sum of digits as the key.\n                
Similarly to [1. Two Sum](https://leetcode.com/problems/two-sum/), we use hash map to match pairs.\n                     \nInstead of a compliment, we use the sum of digits as the key.\n                        \nAs we are looking for a maximum, we store largest number so far as a hash map value.\n                        \n**C++**\n```cpp\nint maximumSum(vector<int>& nums) {\n    int res = -1, d_n[82] = {}; // 9 * 9\n    for (int n : nums) {\n        int d = 0;\n        for (int nn = n; nn; nn /= 10)\n            d += nn % 10;\n        if (d_n[d])\n            res = max(res, d_n[d] + n);\n        d_n[d] = max(d_n[d], n);\n    }\n    return res;\n}\n```
[]