Python3, One Line
Code - Readable Solution\n\nclass Solution:\n    def minMaxDifference(self, num: int) -> int:\n        a=str(num)\n        amax=amin=a\n        doneMax=doneMin=
# Code - Readable Solution\n```\nclass Solution:\n    def minMaxDifference(self, num: int) -> int:\n        a=str(num)\n        amax=amin=a\n        doneMax=doneMin=0\n        for d in a:\n            if d!=\'9\' and not doneMax:\n                amax=\'\'.join(ch if ch!=d else \'9\' for ch in a)\n                doneMax=1\n            if d!=\'0\' and not doneMin:\n                amin=\'\'.join(ch if ch!=d else \'0\' for ch in a)\n                doneMin=1\n        return int(amax)-int(amin)\n```\n\n# Code - One Line for Fun\n```\nclass Solution:\n    def minMaxDifference(self, num: int) -> int:\n        return max(int(\'\'.join(ch if ch!=d else \'9\' for ch in str(num))) for d in str(num)) - min(int(\'\'.join(ch if ch!=d else \'0\' for ch in str(num))) for d in str(num))\n```\n# Code - Readable 4 lines\n```\nclass Solution:\n    def minMaxDifference(self, num: int) -> int:\n        a=str(num)\n        amax=max(int(\'\'.join(ch if ch!=d else \'9\' for ch in a)) for d in a)\n        amin=min(int(\'\'.join(ch if ch!=d else \'0\' for ch in a)) for d in a)\n        return amax-amin\n```\n\n
['Python3']