Sponsored
Solve with full IDE support and test cases
Use these hints if you're stuck. Try solving on your own first.
Try to remap the first non-nine digit to 9 to obtain the maximum number.
Try to remap the first non-zero digit to 0 to obtain the minimum number.