LeetCode solutions

3367. Find the Sum of Encrypted Integers

My accepted Python solution to LeetCode problem 3367, Find the Sum of Encrypted Integers, running in 59ms.

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

Read the problem on LeetCode View on GitHub

Python

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

python
class Solution:
    def sumOfEncryptedInt(self, nums: List[int]) -> int:
        def encrypt(n):
            s = str(n)
            max_digit = max(s)
            return int(max_digit * len(s))
        
        return sum(encrypt(n) for n in nums)

Source