Skip to content

Commit

Permalink
leetcode find the sum of encrypted ints
Browse files Browse the repository at this point in the history
  • Loading branch information
ferhatelmas committed Mar 18, 2024
1 parent c350e88 commit ef525da
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions leetcode/algorithms/easy/find_the_sum_of_encrypted_integers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from typing import List


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

return sum(encrypt(e) for e in nums)

0 comments on commit ef525da

Please sign in to comment.