Problem 2342 · Medium

Max Sum of a Pair With Equal Sum of Digits

Keep the largest number seen for each digit sum in a hash map, so each new number pairs with its best partner in one lookup.

Open the interactive visualisation