You are given an integer num.
You can apply the following operation to num:
Choose a digit num.
Choose a new digit
Replace every occurrence of num with
Return the difference between the maximum value and the minimum value you can obtain by applying this operation independently for each case.
Note:
The resulting number is allowed to have leading zeros.
The chosen digit
must be mapped to the same digit across all of its occurrences in num.
Constraints:
num
You are given an integer num.
You can apply the following operation to num:
Choose a digit num.
Choose a new digit
Replace every occurrence of num with
Return the difference between the maximum value and the minimum value you can obtain by applying this operation independently for each case.
Note:
The resulting number is allowed to have leading zeros.
The chosen digit
must be mapped to the same digit across all of its occurrences in num.
Constraints:
num