3079. Find the Sum of Encrypted Integers

You are given an integer array

`nums`

containingpositiveintegers. We define a function`encrypt`

such that`encrypt(x)`

replaceseverydigit in`x`

with thelargestdigit in`x`

. For example,`encrypt(523) = 555`

and`encrypt(213) = 333`

.Return

the.sumof encrypted elements

1 | class Solution { |