Skip to content

Commit 01b4bb5

Browse files
Merge pull request #1988 from CodingTestStudy2/염혜정
[염혜정] Day07
2 parents 6b937cb + eac4696 commit 01b4bb5

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// O(logkn)
2+
3+
class Solution {
4+
public int sumBase(int n, int k) {
5+
int total = 0;
6+
while (n > 0) {
7+
total += n % k;
8+
n /= k;
9+
}
10+
return total;
11+
}
12+
}

0 commit comments

Comments
 (0)