3079. Find the Sum of Encrypted Integers
You are given an integer array
nums
containing positive integers. We define a functionencrypt
such thatencrypt(x)
replaces every digit inx
with the largest digit inx
. For example,encrypt(523) = 555
andencrypt(213) = 333
.Return the sum of encrypted elements.