✅✅✅ C++ Easy solution : Beats 100%  ---> By min heap
Intuition\nWe have to delete * and  the smallest non-\'*\' character to its left. \n# Approach\nFor smallest , Heap only give smallest number in O(1) complexity
# Intuition\nWe have to delete * and  the smallest non-\'*\' character to its left. \n# Approach\nFor smallest , Heap only give smallest number in O(1) complexity. so, we took heap Data structure. And we have to return as it is order except the deleted one .. so we have to track the index. we push {char,index} in Heap . \n\n# Complexity\n- Time complexity:\nO(n) + O(n) -> O(n)\n\n- Space complexity:\nO(n)\n\n# Code\n```\nclass cmp {\n    public:\n       bool operator()(pair<char,int>&a, pair<char,int>&b){\n           if(a.first != b.first){\n               return a.first > b.first;\n           }\n           else return a.second < b.second;\n      }\n};\nclass Solution {\npublic:\n    string clearStars(string s) {\n       priority_queue<pair<char,int>,vector<pair<char,int>>,cmp>pq;\n\n        for(int i=0;i<s.size();i++){\n            if(s[i]==\'*\'){\n                auto top=pq.top(); pq.pop();\n                int index=top.second;\n                s[index]=\'*\';\n            }\n            else{\n                pq.push({s[i],i});\n            }\n        }\n\n        string ans="";\n        for(char ch : s){\n            if(ch!=\'*\'){\n                ans+=ch;\n            }\n        }\n        \n        return ans;\n        \n    }\n   \n};\n```
['C++']