LeetCode solutions

3606. Minimum Element After Replacement With Digit Sum

My accepted Python solution to LeetCode problem 3606, Minimum Element After Replacement With Digit Sum, running in 10ms.

  • Difficulty: Easy
  • Python
  • Runtime 10ms
  • Memory 17.2MB

Read the problem on LeetCode View on GitHub

Python

Accepted on LeetCode — runtime 10ms, memory 17.2MB, accepted 2026-01-01.

python
class Solution:
    def minElement(self, nums: List[int]) -> int:
        def digit_sum(n):
            return sum(int(d) for d in str(n))
        
        return min(digit_sum(num) for num in nums)

Source