Search⌘ K
AI Features

Max Sum of a Pair With Equal Sum of Digits

Try to solve the Max Sum of a Pair With Equal Sum of Digits problem.

We'll cover the following...

Statement

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.

...