Eazy Java Solution Using HashMap<>💀...
IntuitionApproachComplexity
Time complexity:O(n)

Space complexity:O(n)
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:O(n)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:O(n) 
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public String clearStars(String s) {
        int n = s.length();
        HashMap<Character, Stack<Integer>> positionMap = new HashMap<>();
        for(char c = 'a'; c <= 'z'; c++){
            positionMap.put(c, new Stack<>());
        }
        
        boolean removeIndex[] = new boolean[n];

        for(int i = 0; i < n; i++){
            char curr = s.charAt(i);

            if(curr == '*'){
                for(char c = 'a'; c <= 'z'; c++){
                    if(!positionMap.get(c).isEmpty()){
                        int removeIdx = positionMap.get(c).pop();
                        removeIndex[removeIdx] = true;
                        break;
                    }
                }
            } else {
                positionMap.get(curr).push(i);
            }
        }
        StringBuilder result = new StringBuilder();
        for(int i = 0; i < n; i++){
            if(!removeIndex[i] && s.charAt(i) != '*'){
                result.append(s.charAt(i));
            }
        }
        return result.toString();
    }
}
```
['Java']