PYTHON || BEGINNERS FRIENDLY || 100% FASTER PY SOLN.
LOGIC \u2013 \nIf number is less than 0 , we can just sort its digits (w/o \u2018-\u2018 sign) in descending order, and return the number multiplied by -1\nBut 
LOGIC \u2013 \n***If number is less than 0 , we can just sort its digits (w/o \u2018-\u2018 sign) in descending order, and return the number multiplied by -1***\nBut if number is greater than 0,\n**first we\u2019ll sort its digits in ascending order and find the smallest digit and add total number of 0s after it(provided 0s are present in the given number)***\n\n```\nclass Solution:\n    def smallestNumber(self, num: int) -> int:       \n\n        if num<0:\n            n_str = list(str(num*(-1)))\n            gt=sorted(n_str,reverse=1)\n            ans = \'\'.join(gt)\n            return (int(ans)*-1)\n\n        else:\n            n_str = list(str(num))\n            gt = sorted(n_str)\n            m=n_str.count(\'0\')\n            for t in range(m):\n                gt.insert(m+1,\'0\')\n            ans = \'\'.join(gt)\n            return (int(ans))\n```\n
['Math', 'Python']