You are given three positive integers num1, num2, and num3.
First, convert each number into a 4-digit string.
If a number has fewer than 4 digits, add leading zeros to make it 4 digits long.
Then, form a new 4-digit result where the i-th digit is the minimum digit among the i-th digits of the three converted numbers.
Finally, return the resulting number without leading zeros. If the whole number becomes 0, return 0.
Input: num1 = 45, num2 = 504, num3 = 9001
Output: 4001
Explanation:
num1 → "0045" num2 → "0504" num3 → "9001" Digits: 1st: min(0,0,9) = 0 2nd: min(0,5,0) = 0 3rd: min(4,0,0) = 0 4th: min(5,4,1) = 1 → Result "0001" → return 1
Input: num1 = 2222, num2 = 1212, num3 = 2121
Output: 1111
Input: num1 = 9000, num2 = 8000, num3 = 7000
Output: 7000
Accepted:
Submission: