EASY C++ 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```\nclass Solution {\npublic:\n    int minMaxDifference(int num) {\n       string no=to_string(num);\n       char digit;\n       char mdigit=no[0];\n       for(int i=0; i<no.size(); i++)\n        {\n            if(no[i]!=\'9\'){\n                digit=no[i];\n                break;\n            }\n\n        }\n        string copy=no;\n        for(int i=0; i<no.size(); i++){\n            if(no[i]==digit)\n            no[i]=\'9\';\n            if(copy[i]==mdigit)\n            copy[i]=\'0\';\n        }\n        int max=stoi(no);\n        int min=stoi(copy);\n        return max-min;\n    }\n};\n```
['C++']