Skip to content

Commit b7af7ac

Browse files
Merge pull request #1973 from CodingTestStudy2/최민지
[최민지] Day04
2 parents 3577c73 + 046a909 commit b7af7ac

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎leetcode3/최민지/3982.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class Solution:
2+
def maxDigitRange(self, nums: list[int]) -> int:
3+
dict = {}
4+
for num in nums:
5+
num_list = list(map(int, str(num)))
6+
range = max(num_list) - min(num_list)
7+
if range not in dict:
8+
dict[range] = []
9+
dict[range].append(num)
10+
max_key = max(dict)
11+
12+
return sum(dict[max_key])
13+
14+
15+

0 commit comments

Comments
 (0)