Python
\n\n\nclass Solution:\n    def minMaxDifference(self, num: int) -> int:\n        num_str_min = num\n        num_str_max = num\n        num = str(num)\n        f
\n\n```\nclass Solution:\n    def minMaxDifference(self, num: int) -> int:\n        num_str_min = num\n        num_str_max = num\n        num = str(num)\n        for i in num:\n            if i < \'9\':\n                num_str_max = int(num.replace(i, \'9\'))\n                break\n        for i in num:\n            if i != \'0\':\n                num_str_min = int(num.replace(i, \'0\'))\n                break\n        return num_str_max - num_str_min\n```
['Python']