Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stack = deque()
- counts = []
- commends = task_1.parse_input(input_)
- for commend in commends:
- if len(commend)<3:
- if commend[0] == 1:
- stack.append(commend[1])
- if commend[0] == 2:
- if commend[1] in stack:
- stack.remove(commend[1])
- if commend[0] == 3:
- counts.append(sorted(stack).count(commend[1]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement