Time Complexity: O(n)
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        // set<int> ss;\n        priority_queue<int> a[26];\n        for (int i=0;i<s.size();i++){\n            char x = s[i];\n            if (x==\'*\'){\n                for (int k=0;k<26;k++){\n                    if (!a[k].empty() and a[k].top()<i){\n                        s[a[k].top()]=\'0\';\n                        a[k].pop();\n                        break;\n                    }\n                }\n            }\n            else{\n                a[x-\'a\'].push(i);\n            }\n        }\n        string ans="";\n        for (auto x:s){\n            if (x==\'*\' or x==\'0\')continue;\n            ans+=x;\n        }\n        return ans;\n    }\n};\n\n```
['Heap (Priority Queue)', 'C++']