Skip to content

Commit

Permalink
자릿수 더하기
Browse files Browse the repository at this point in the history
  • Loading branch information
dudwns committed Mar 24, 2023
1 parent 48f12ff commit 637cbf6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Programmers/exam35.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function solution(n) {
return n
.toString()
.split("")
.reduce((a, c) => a + Number(c), 0);
}

0 comments on commit 637cbf6

Please sign in to comment.