[C++] | Unordered Map | Easy Understanding
```\nclass Solution {\npublic:\n    string smallestSubsequence(string s) {\n        unordered_mapmp;\n        \n        for(int i=0;ivisited(26,false);\n       
```\nclass Solution {\npublic:\n    string smallestSubsequence(string s) {\n        unordered_map<char,int>mp;\n        \n        for(int i=0;i<s.length();i++)mp[s[i]]=i; //store last index of occurance\n        \n        vector<bool>visited(26,false);\n        \n        string result = "";\n        for(int i=0;i<s.length();i++){\n            if(visited[s[i] - \'a\'])continue;\n            \n            while(!result.empty() && result.back() > s[i] && mp[result.back()] > i){\n                visited[result.back()-\'a\'] = false;\n                result.pop_back();\n            }\n            result.push_back(s[i]);\n            visited[s[i] - \'a\'] = true;\n        }\n        return result;\n    }\n};
['Array', 'C', 'C++']