Simple Easy Solution using heap||priority Queue||100%beats 🔥🔥
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 {\n    public String clearStars(String s) {\n        if(!s.contains("*"))\n        {\n            return s;\n        }\n        // StringBuffer str=new StringBuffer();\n        // for(int i=0;i<s.length();i++)\n        // {\n        //     if(s.charAt(i)!=\'*\')\n        //     {\n        //         str.append(s.charAt(i));\n        //     }\n        //     else\n        //     {\n        //        int j=str.length()-1;\n        //         int ind=j;\n        //        char min=str.charAt(j);\n        //         while(j>=0)\n        //         {\n        //             if(str.charAt(j)<min)\n        //             {\n        //                 min=str.charAt(j);\n        //                 ind=j;\n        //             }\n        //             j--;\n        //         }\n        //         str.deleteCharAt(ind);\n        //     }\n        // }\n        // return str.toString();\n        StringBuilder result = new StringBuilder();\n        PriorityQueue<Character> pq= new PriorityQueue<>();\n        for (char c : s.toCharArray()) {\n            if (c != \'*\') {\n                result.append(c);\n                pq.offer(c); \n            } else if (!pq.isEmpty()) {\n                char minChar =pq.poll();\n                result.deleteCharAt(result.lastIndexOf(String.valueOf(minChar)));\n            }\n        }\n        return result.toString();\n        \n    }\n}\n```
['Heap (Priority Queue)', 'Java']