Skip to content

Commit 008a44a

Browse files
Merge pull request #1984 from CodingTestStudy2/황은지
[황은지] Day07
2 parents b6f00bd + 96859f7 commit 008a44a

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+
/**
2+
* @param {number} n
3+
* @param {number} k
4+
* @return {number}
5+
*/
6+
var sumBase = function(n, k) {
7+
const changedNumStr=n.toString(k)
8+
return changedNumStr.split('').reduce((acc,cur)=>acc+Number(cur),0);
9+
};

0 commit comments

Comments
 (0)