Skip to content

Commit 2de0fcb

Browse files
Merge pull request #1986 from CodingTestStudy2/최원준
[최원준] Day07
2 parents 5a154ae + d1dc867 commit 2de0fcb

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Solution:
2+
def sumBase(self, n: int, k: int) -> int:
3+
ans = 0
4+
5+
while n:
6+
n, r = divmod(n, k)
7+
ans += r
8+
9+
return ans

0 commit comments

Comments
 (0)