Skip to content

Commit e799397

Browse files
authored
Create 3079. Find the Sum of Encrypted Integers.py
1 parent 1c147dc commit e799397

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
3+
'''
4+
1. 아이디어 :
5+
-
6+
7+
2. 시간복잡도 :
8+
O(n * m)
9+
10+
3. 자료구조/알고리즘 :
11+
-
12+
13+
'''
14+
class Solution:
15+
def sumOfEncryptedInt(self, nums: List[int]) -> int:
16+
17+
def encrypt(x):
18+
n = len(str(x))
19+
cmax = 0
20+
while x:
21+
remain = x%10
22+
cmax = max(cmax, remain)
23+
x = x//10
24+
return int(str(cmax) * n)
25+
26+
return sum([encrypt(x) for x in nums])

0 commit comments

Comments
 (0)