diff --git "a/leetcode3/\354\265\234\353\257\274\354\247\200/3982.py" "b/leetcode3/\354\265\234\353\257\274\354\247\200/3982.py" new file mode 100644 index 00000000..064b5ff2 --- /dev/null +++ "b/leetcode3/\354\265\234\353\257\274\354\247\200/3982.py" @@ -0,0 +1,15 @@ +class Solution: + def maxDigitRange(self, nums: list[int]) -> int: + dict = {} + for num in nums: + num_list = list(map(int, str(num))) + range = max(num_list) - min(num_list) + if range not in dict: + dict[range] = [] + dict[range].append(num) + max_key = max(dict) + + return sum(dict[max_key]) + + + \ No newline at end of file