#2815
Max Pair Sum in an Array
pupil · 400 · lc easy +24 · 60.4% accepted · 436 likes · top 59%
Description
An integer array nums is given. Among all pairs of numbers that share the same largest digit, find the pair with the maximum sum.
For instance, in 2373 the largest digit is 7.
Return that maximum sum, or -1 if no qualifying pair exists.
Code
1
2
3