O(N*Log(n)) || Python3 || Beat 99% || 
IntuitionThe question asks you to find pair, whenever I read "maximum pair" frequence table is my first thought.ApproachUse Dictionary to make table. Key will b
# Intuition
The question asks you to find pair, whenever I read "maximum pair" frequence table is my first thought.
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
Use Dictionary to make table. Key will be the sum of digits and values will be a list of all the numbers whose sum is same.
Itereate through the values(list) in dictonary and use len() to to check for list with 2 or more values since we need a pair of atleast 2.
Get 2 largest values from the list; that is our biggest sum for that digit and compare it with max vairable. The loop will continue and find which same digit sum pair has heighest sum.

Note:
```i != j``` only means you can't repeat a value so you don't need to use 2 loops
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity: O(N(LogK))
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:O(N)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
class Solution:
    def maximumSum(self, nums: List[int]) -> int:
        dic = defaultdict(list)
        m = -1
        for i in range(len(nums)):
            num = nums[i]
            n = 0
            while num!=0:
                n = n + num%10
                num = num//10
            dic[n].append(nums[i])
        for val in dic.values():
            if len(val)>=2:
                l = heapq.nlargest(2, val)
                s = l[0]+l[1]
                m = max(s,m)
        return m
```
['Array', 'Heap (Priority Queue)', 'Python3']