C++ O(N*26)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    string clearStars(string &s)\n    {\n        // vector<int> pos(26,-1);\n        vector<vector<int>> pos(26,vector<int>(0));\n        for(int i=0;i<s.length();i++)\n        {\n            if(s[i]!=\'*\')\n                pos[s[i]-\'a\'].push_back(i);\n            \n            \n            if(s[i]==\'*\')\n            {\n                for(int i=0;i<26;i++)\n                {\n                    if(pos[i].size()>0)\n                    {\n                        s[pos[i].back()]=\'@\';\n                        pos[i].pop_back();\n                        // pos[i]=-1;\n                        break;\n                    }\n                        \n}\n                \n}\n}\n        string ans="";\n        for(auto a:s)\n        {\n            if(a!=\'@\'&&a!=\'*\')\n                ans.push_back(a);\n        }\n        return ans;\n    }\n};\n```
['C++']