hints are sometimes life - saving :D with help of hints you can araamse do it bas :D
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```cpp []\nclass Solution {\npublic:\n    int minMaxDifference(int num) {\n        string nums=to_string(num);\n        char maxo;\n        char mino;\n\n        for(int i=0;i<nums.length();i++)\n        {\n            if(nums[i]!=\'9\')\n            {\n                maxo=nums[i];\n                break;\n            }\n        }\n        for(int i=0;i<nums.length();i++)\n        {\n            if(nums[i]!=\'0\')\n            {\n                mino=nums[i];\n                break;\n            }\n        }\n\n        string maxum=nums;\n        string minum=nums;\n\n        for(int i=0;i<nums.length();i++)\n        {\n            if(nums[i]==maxo)\n            {\n                maxum[i]=\'9\';\n            }\n\n            if(nums[i]==mino)\n            {\n                minum[i]=\'0\';\n            }\n        }\n\n        int mx=stoi(maxum);\n        int mn=stoi(minum);\n\n        return mx-mn;\n\n\n    }\n};\n```
['C++']