PYTHON BEATS 100% OF RUNTIME✅
Approach\n1- Check if num is negative or not\n\n2- Store all digits in num in an array except the zeros\n\n3- If num is negative -> you need to order the array 
# Approach\n1- Check if num is **negative** or not\n\n2- **Store** all **digits** in num in an array **except** the **zeros**\n\n3- If num is **negative** -> you need to order the array in **descending** order and add all **zeros** to the **left**\nif num is **positive** -> you need to order the array in **ascending** order and add all **zeros** to the **right** in the **second** **position**. Not in the first because the number can\'t have any leading zeros.\n\nps: if you have any improvements, let me know :)\n\n\n# Code\n```\nclass Solution(object):\n    def smallestNumber(self, num):\n\n        if num == 0:\n            return 0\n        \n        isNegative, nums, countZero, s = False, [], 0, str(num)\n        \n        if  num < 0:\n            isNegative = True\n            s = s[1:]\n        \n        for i in range(len(s)):\n            if s[i] != \'0\':\n                nums.append(s[i])\n            else:\n                countZero += 1\n\n        nums.sort(reverse=isNegative)\n        newN = \'\'.join(nums)\n\n        if isNegative:\n            return int(\'-\' + newN + \'0\' * countZero)\n\n        return int(newN[0] + \'0\' * countZero + newN[1:])\n    \n```
['Sorting', 'Python', 'Python3']