EASY SOLUTION BEATS 100%
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
class Solution:
    def minMaxDifference(self, num: int) -> int:
        s=str(num)
        s=[int(n) for n in s]
        a='9'
        for i in s:
            if int(i)!=9:
                a=i
                break
        s1=''
        s2=''
        for i in s:
            if i==a:
                s1+='9'
            else:
                s1+=str(i)
        a=s[0]
        for i in s:
            if i==a:
                s2+='0'
            else:
                s2+=str(i)
        return int(s1)-int(s2)
```
['Python3']