Given an integer array nums, choose two distinct indices i and j such that the sum of digits of nums[i] is equal to the sum of digits of nums[j]. Among all such valid pairs, return the maximum possible value of nums[i] + nums[j]. If no valid pair exists, return -1.
Constraints:
nums.length
nums[i]
Given an integer array nums, choose two distinct indices i and j such that the sum of digits of nums[i] is equal to the sum of digits of nums[j]. Among all such valid pairs, return the maximum possible value of nums[i] + nums[j]. If no valid pair exists, return -1.
Constraints:
nums.length
nums[i]