C++ || EASY SOLUTION || EASY TO UNDERSTAND || 100% FASTER || COMMENTS ADDED
\n\n\n    class Solution {\n    public:\n    long long smallestNumber(long long num) {\n        long long ans=0;\n        string s=to_string(abs(num)); // CONVE
\n\n\n    class Solution {\n    public:\n    long long smallestNumber(long long num) {\n        long long ans=0;\n        string s=to_string(abs(num)); // CONVERTING LONG LONG TO STRING\n        sort(s.begin(),s.end()); //SORTING THE STRING\n        int i=0;\n        if(num<=0) // IF NUMBER IS LESS THAN OR EQUAL TO ZERO\n        {\n            reverse(s.begin(),s.end()); //WE HAVE TO FIND GREATER ELEMENT SO REVERSE THE \n\t\t\t // STRING(AS -510 IS SMALLER THAN -015)\n            ans=-(stoll(s)); // CONVERTING STRING TO LONG LONG\n        }\n        else{\n            while(s[i]==\'0\') //AS IN QUESTION THERE IS NO LEADING ZERO BUT AFTER SORTING WE GET \n\t\t\t//ZERO AT STARTING SO THIS STEP WILL SWAP THE LEADING ZERO WITH SMALLEST NON ZERO NUMBER\n            {\n                i++;\n            }\n            swap(s[0],s[i]); // SWAPPING OF ELEMENTS\n            ans=stoll(s); // CONVERSION OF STRING TO LONG LONG \n        }\n        return ans;\n    }\n    };
['C']