[LeetCode] 2342. Max Sum of a Pair With Equal Sum of Digits (Python)
·
알고리즘/LeetCode
난이도: Medium문제 설명 You are given a 0-indexed array nums consisting of positive integers. You can choose two indices i and j, such that i != j, and the sum of digits of the number nums[i] is equal to that of nums[j]. Return the maximum value of nums[i] + nums[j] that you can obtain over all possible indices i and j that satisfy the conditions. 문제 예제Example 1:Input: nums = [18,43,36,13,7]Output: 54E..