A simple Python solution | Python 02
Code

# Code
```python []
class Solution:
    def maximumSum(self, nums):
        dsm = {}
        max_sum = -1

        for num in nums:
            ds = sum(int(d) for d in str(num))
            if ds in dsm:
                max_sum = max(max_sum, num + dsm[ds])
                dsm[ds] = max(dsm[ds], num)
            else:
                dsm[ds] = num

        return max_sum
  
```
['Python']