https://programmers.co.kr/learn/courses/30/lessons/12931?language=javascript
function solution(n) {
let answer = 0;
const strNumber = String(n);
for (let i = 0; i < strNumber.length; i++) {
answer += Number(strNumber[i]);
}
return answer;
}