Skip to content

Commit 7f5ff5e

Browse files
Merge pull request #1682 from CodingTestStudy2/최원준
[최원준] Day18
2 parents 71f75f5 + 5fa7527 commit 7f5ff5e

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
3+
'''
4+
1. 아이디어 :
5+
-
6+
7+
2. 시간복잡도 :
8+
O(len(n))
9+
10+
3. 자료구조/알고리즘 :
11+
-
12+
13+
'''
14+
15+
class Solution:
16+
def checkDivisibility(self, n: int) -> bool:
17+
18+
string = str(n)
19+
n_sum = 0
20+
n_product = 1
21+
22+
for c in string:
23+
n_int = int(c)
24+
n_sum += n_int
25+
n_product *= n_int
26+
27+
return n%(n_sum+n_product) == 0

0 commit comments

Comments
 (0)