How to solve this question?

Правка en1, от JulitoPeligro, 2022-06-25 16:45:01

I have multiple queries and queries are of 2 types and i also have empty stack like datastructure but i can remove any element in a stack in 0(1) .If given type 1 query i need to add that element into the stack. If given type 2 i need to remove the element which has highest frequency in the stack and if there are multiple elements with highest frequency i need to remove the element which is near to the top of stack. n<=10^5

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский JulitoPeligro 2022-06-25 16:45:01 455 Initial revision (published)