Concise and Clear Solution in Python - Easy to Understand 🐍
Example:
Suppose nums = [32, 23, 41] (sorted as [23, 32, 41]):

23 → Digit sum = 2+3=5 → Store {5: 23}.


32 → Digit sum = 3+2=5 (exists) →
Update max_sum = 23
**Example:**  
Suppose `nums = [32, 23, 41]` (sorted as `[23, 32, 41]`):  
1. **23** → Digit sum = `2+3=5` → Store `{5: 23}`.  
2. **32** → Digit sum = `3+2=5` (exists) → 
Update `max_sum = 23 + 32 = 55`, store `{5: 32}`.
  
3. **41** → Digit sum = `4+1=5` (exists) → 
Update `max_sum = max(55, 32 + 41) = 73`, store `{5: 41}`.  

Final result: `73`.

# Complexity
- Time complexity: $$O(n log n)$$

- Space complexity: $$ O(n) $$

# Code
```python3 []
class Solution:
    def digit_sum(num):
        return sum(map(int, str(num)))

    def maximumSum(self, nums: List[int]) -> int:
        nums.sort()
        sum_to_num = {}
        max_sum = -1

        for num in nums:
            curr_sum = self.digit_sum(num)

            if curr_sum in sum_to_num:
                max_sum = max(max_sum, sum_to_num[curr_sum] + num)

            sum_to_num[curr_sum] = num
        
        return max_sum
```
['Hash Table', 'Sorting', 'Python3']