
n을 문자열 형변환 하여 각 자릿수에 해당하는 값을 곱함n이 나오는 배열을 반환function decimalRepresentation(n: number): number[] {
const strN = String(n)
const nLen = strN.length
const decimal = []
for(let i = 0; i < nLen; i++) {
const digit = Number(strN[i])
if(!digit) continue
let power = '1'
for(let j = 0; j < nLen - (i + 1); j++) {
power += '0'
}
decimal.push(digit * Number(power))
}
return decimal
};