Easy C++ O(N*26) solution
Code\n\nclass Solution {\npublic:\n    string clearStars(string s) {\n        vector<int>v(26,0);\n        int n = s.size();\n        string temp = "";\n       
# Code\n```\nclass Solution {\npublic:\n    string clearStars(string s) {\n        vector<int>v(26,0);\n        int n = s.size();\n        string temp = "";\n        for(int i=0;i<n;i++){\n            if(s[i]!=\'*\') {\n                v[s[i]-\'a\']++;\n                temp.push_back(s[i]);\n            }\n            else{\n                char c;\n                for(int i=0;i<26;i++){\n                    if(v[i]>0){\n                        v[i]--;\n                        c=i+\'a\';\n                        break;\n                    }\n                }\n                for(int j=temp.size()-1;j>=0;j--){\n                    if(temp[j]==c){\n                        temp.erase(j,1);\n                        break;\n                    }\n                }\n            }\n        }\n        return temp;\n    }\n};\n```
['C++']