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
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
Python
Accepted on LeetCode — runtime 59ms, memory 17.2MB, accepted 2026-01-01.
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)