[PYTHON 3] Stacks | Dictionary | Easy to Read Solution
\nclass Solution:\n    def smallestSubsequence(self, text: str) -> str:\n        stack , counter , visited = [] , {} , {}\n        for letter in text:\n        
```\nclass Solution:\n    def smallestSubsequence(self, text: str) -> str:\n        stack , counter , visited = [] , {} , {}\n        for letter in text:\n            if letter not in visited:\n                visited[letter] = False\n                counter[letter] = 1\n            else:\n                counter[letter] += 1\n        for letter in text:\n            counter[letter] -= 1\n            if visited[letter]:\n                continue\n            while stack and letter < stack[-1] and counter[stack[-1]] > 0:\n                visited[stack[-1]] = False\n                stack.pop()\n            stack.append(letter)\n            visited[letter] = True\n        return "".join(stack)\n```
['Python3']