Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. stack = deque()
  2. counts = []
  3. commends = task_1.parse_input(input_)
  4. for commend in commends:
  5. if len(commend)<3:
  6. if commend[0] == 1:
  7. stack.append(commend[1])
  8. if commend[0] == 2:
  9. if commend[1] in stack:
  10. stack.remove(commend[1])
  11. if commend[0] == 3:
  12. counts.append(sorted(stack).count(commend[1]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement