Easy Python Solution 
IntuitionThe problem involves processing a string where stars (*) represent deletions. When a star is encountered, it indicates that the last character before t
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
The problem involves processing a string where stars (*) represent deletions. When a star is encountered, it indicates that the last character before the star should be removed. The goal is to process the string by handling each star and updating the string accordingly. The core idea is to:

1.Track the positions of each character in the string.
2.Whenever a star (*) is encountered, remove the most recent character that appeared before it (i.e., the last character that has not already been removed).
3.The challenge lies in efficiently finding and removing the most recent character for each star.

# Approach
<!-- Describe your approach to solving the problem. -->
Track Occurrences of Characters:

Use a dictionary last where each key is a character ('a' to 'z'), and the value is a list that stores the positions (indices) where the character appears in the string. This helps us know where each character is located in the string.
Process Each Character:

Iterate through the string character by character:
If the character is not a *, simply record its position in the last dictionary.
If the character is a *, check the most recent character in the string that hasn't been removed:
Look through the last dictionary to find the most recent character that still has a position recorded in its list.
Remove the most recent character by marking its corresponding position as empty in the result list.
Pop the last occurrence from the last list for that character to ensure it’s considered removed.
Rebuild the String:

After processing all characters, convert the result list back into a string, skipping any empty positions (those that have been removed).
This approach ensures that the string is processed in a single pass and handles the removal of characters efficiently.

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

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

# Code
```python3 []
class Solution:
    def clearStars(self, s: str) -> str:
        last={chr(i):[] for i in range(97,123)}
        ans=list(s)
        for i in range(len(s)):
            if s[i]=="*":
                ans[i]=""
                for k in "abcdefghijklmnopqrstuvwxyz":
                    if last[k]:
                        ans[last[k][-1]]=""
                        last[k].pop()
                        break
            else:
                last[s[i]].append(i)
        return "".join(ans)



```
['Greedy', 'Python3']