Skip to content

Commit 71f75f5

Browse files
Merge pull request #1683 from choifi/choiminji
[최민지] Day18
2 parents c281fb0 + 92293f4 commit 71f75f5

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

leetcode3/최민지/3622.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class Solution:
2+
def checkDivisibility(self, n: int) -> bool:
3+
s = str(n)
4+
totalPlus = 0
5+
totalDupli = 1
6+
7+
for i in s:
8+
totalPlus += int(i)
9+
totalDupli *= int(i)
10+
11+
if n % (totalPlus + totalDupli) == 0:
12+
return True
13+
else:
14+
return False
15+
16+

0 commit comments

Comments
 (0)