
nums의 모든 요소를 암호화 과정을 거쳐 합산function sumOfEncryptedInt(nums: number[]): number {
return nums.reduce((acc, cur) => acc + encrypt(cur), 0)
};
function encrypt(num: number) {
const digit = []
while(num) {
digit.push(num % 10)
num = Math.floor(num / 10)
}
const max = Math.max(...digit)
const len = digit.length
const strEncrypt = String(max).repeat(len)
return Number(strEncrypt)
}