10 line code using string with comments easy to understand
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: 15log(15)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: 0(n);\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    long long smallestNumber(long long num) {\n        string s=to_string(num);\n        if(num>=0) sort(s.begin(),s.end());   //if no is positive\n        else sort(s.begin(),s.end(),greater<char>()); //if no is negative then sort in decending order\n\n        if(num>0){ //if no is positive\n            int ind=s.find_first_not_of(\'0\');  //s.find_first_not_of will find the first element which is non zero  \n            //eg  00011199 it will give the index 3\n            // and we will swap it with first 0 index now string become 10001199 \n            swap(s[0],s[ind]);\n        }\n\n        long long ans=stoll(s); // stio is for int for long long we use stoll\n        if(num<0) ans*=-1;\n        return ans;\n    }\n};\n```
['Math', 'String', 'C++']