3270. Find the Key of the Numbers
You are given three positive integers
num1
,num2
, andnum3
.The
key
ofnum1
,num2
, andnum3
is defined as a four-digit number such that:
- Initially, if any number has less than four digits, it is padded with leading zeros.
- The
ith
digit (1 <= i <= 4
) of thekey
is generated by taking the smallest digit among theith
digits ofnum1
,num2
, andnum3
.Return the
key
of the three numbers without leading zeros (if any).
1 | func generateKey(num1, num2, num3 int) int { |