Easy C++ || Priority Queue(Min Heap) || O(nlogn) 🔥🚀💯
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  priority_queue<pair<char, int>, vector<pair<char, int>>, greater<pair<char, int>>>heap; \n        for (int i = 0; i < s.size(); i++) {\n            if (s[i] != \'*\') {\n                heap.push({s[i], -i}); \n            } else if (s[i] == \'*\') {\n                heap.pop();\n            }\n        }\n        \n        set<int> st;\n        while (!heap.empty()) {\n            st.insert(-heap.top().second);\n            heap.pop();\n        }\n        \n        string result = "";\n        for (int i = 0; i < s.size(); i++) {\n            if (st.count(i)) {\n                result += s[i];\n            }\n        }\n        \n        return result;\n    }\n};\n```
['Heap (Priority Queue)', 'Ordered Set', 'C++']