python 3 97% faster
\nclass Solution:\n    def smallestNumber(self, num: int) -> int:\n        def s(l):\n            for i ,n in enumerate(l):\n                if n!=\'0\':\n     
```\nclass Solution:\n    def smallestNumber(self, num: int) -> int:\n        def s(l):\n            for i ,n in enumerate(l):\n                if n!=\'0\':\n                    t=l.pop(i)\n                    break\n            return str(t)+\'\'.join(l)\n        if num>0:\n            l=list(str(num))\n            l.sort()\n            return(s(l))\n        else:\n            l=list(str(num))\n            l.sort(reverse=True)\n            a=l.pop(-1)\n            r=a+\'\'.join(l)\n            return r\n```
[]