Easy Python solution in O(n) Time Complexity
\nclass Solution:\n    def smallestSubsequence(self, s: str) -> str:\n        s=list(s)\n        d={}\n        for i in range(len(s)):\n            d[s[i]]=i\n 
```\nclass Solution:\n    def smallestSubsequence(self, s: str) -> str:\n        s=list(s)\n        d={}\n        for i in range(len(s)):\n            d[s[i]]=i\n        stack=[]\n        for i in range(len(s)):\n            if s[i] in stack:\n                continue\n            while len(stack)!=0 and d[stack[-1]]>i and stack[-1]>s[i]:\n                stack.pop()\n            stack.append(s[i])\n        return(("").join(stack))\n            \n       \n                \n```
['Stack', 'Python']