✅💯🔥Simple Code📌🚀| 💯
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```python []\nclass Solution(object):\n    def minMaxDifference(self, num):\n        """\n        :type num: int\n        :rtype: int\n        """\n        num_str=str(num)\n        num_arr=[int(i) for i in num_str]\n        j=0\n        for i in num_arr:\n            if i!=9:\n                j=i\n                break\n        for i in  range(len(num_arr)):\n            if num_arr[i]==j:\n                num_arr[i]=9\n        maxi=""\n        for i in num_arr:\n            maxi+=str(i)\n        maxi=int(maxi)\n        k=0\n        num_arr_mini=[int(i) for i in num_str]\n        for i in num_arr_mini:\n            if i!=0:\n                k=i\n                break\n        for i in range(len(num_arr_mini)):\n            if num_arr_mini[i]==k:\n                num_arr_mini[i]=0\n        mini=""\n        for i in num_arr_mini:\n            mini+=str(i)\n        mini=int(mini)\n        return (maxi-mini)\n        \n```
['Python']