Easy Solution
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 
# 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```csharp []\npublic class Solution {\n    public int MinMaxDifference(int num) {\n        List<int> a=new List<int>();\n        while(num!=0)\n        {\n            a.Add(num%10);\n            num=num/10;\n        }\n        a.Reverse();\n        int up=0;int dow=a[0]; int max=0;int min=0;\n        for(int i=0;i<a.Count;i++)\n        {\n            if(a[i]<9) \n            {\n                up=a[i];break;\n            }\n        }\n        for(int i=0;i<a.Count;i++)\n        {\n            if(up==a[i])\n            {\n                max=max*10+9;\n            }\n            else\n            {\n                max=max*10+a[i];\n            }\n            if(dow==a[i])\n            {\n                min=min*10+0;\n            }\n            else\n            {\n                min=min*10+a[i];\n            }\n        }\n        return max-min;\n        \n    }\n}\n```
['C#']