Tap here to switch tabs
Problem
Submissions

Problem: Max Pair Sum in an Array

med
30 min
Try to solve the Max Pair Sum in an Array problem.

Statement

You are given an integer array nums. Find the maximum sum of a pair of numbers from nums such that the largest digit in both numbers is equal.

Return the maximum sum among all such pairs, or −1-1 if no valid pair exists.

Constraints:

  • 2≤2 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i] ≤104\leq 10^4

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Max Pair Sum in an Array

med
30 min
Try to solve the Max Pair Sum in an Array problem.

Statement

You are given an integer array nums. Find the maximum sum of a pair of numbers from nums such that the largest digit in both numbers is equal.

Return the maximum sum among all such pairs, or −1-1 if no valid pair exists.

Constraints:

  • 2≤2 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i] ≤104\leq 10^4