Helper Function DigitSum Approach
Intuition & ApproachMy goal here is to find two numbers in the array that have the same digit sum. Amongst these pairs of numbers, we must find the one with the
# Intuition & Approach
My goal here is to find two numbers in the array that have the same digit sum. Amongst these pairs of numbers, we must find the one with the maximum possible sum. 

The strategy we will implement will be to first start by calculating the digit sum of every number. This number will be the key that helps us group the numbers (we will be using a dictionary!)

In our dictionary, the key:value will just be the digitsum:list containing up to two numbers from the original array that have that digit sum.

We want to make sure that while we are doing this, we maintain the two largest numbers. When processing each number: 
- if there's no group for that digit sum, we create it. 
- if there's already a number, compare the current number with the existing one and order them such that the largest comes first
- if there's already two numbers, check if the current number is larger than either of the two and update the pair accordingly

After this grouping, we just iterate over each group. For any group with at least two numbers, compute the sum of the two numbers. The answer SHOULD be the maximum of these sums.

# Complexity
- Time complexity:
$$O(n * d), d for the digits function which takes O(d) and n for all the numbers there are which makes this O(n*d)

- Space complexity:
$$O(n)$$ because we used space with dictionary

# Code
```python3 []
class Solution:
    def maximumSum(self, nums: List[int]) -> int:
        def digit_sum(num):
            s = 0
            while num > 0:
                s += num % 10
                num = num // 10
            return s
        # auxiliary fx
        
        groups = {}
        
        for num in nums:
            ds = digit_sum(num)
            if ds not in groups:
                groups[ds] = [num]
            else:
                current = groups[ds]
                if len(current) == 1:
                    if num > current[0]:
                        groups[ds] = [num, current[0]]
                    else:
                        groups[ds].append(num)
                else:  # len(current) == 2
                    if num > current[0]:
                        groups[ds] = [num, current[0]]
                    elif num > current[1]:
                        groups[ds] = [current[0], num]
        
        max_sum = -1
        for key in groups:
            if len(groups[key]) >= 2:
                current_sum = groups[key][0] + groups[key][1]
                if current_sum > max_sum:
                    max_sum = current_sum
        
        return max_sum if max_sum != -1 else -1
```
['Python3']