import java.util.Deque
class Solution {
fun removeStars(s: String): String {
val st = ArrayDeque<Char>()
s.forEach{ ch ->
if(ch == '*') st.removeLast()
else st.addLast(ch)
}
return st.toList().joinToString(separator="")
}
}