Queue Using Class

JavaScript Medium 3 views
Back to Questions
Next Event Emitter Basics Hard N

Problem Description

Implement a queue with methods enqueue, dequeue, size. Process commands: ENQ x, DEQ, SIZE. Print outputs of DEQ and SIZE.

Input Format

First line q. Next q lines commands.

Output Format

Outputs line by line.

Sample Test Case

Input:
6 ENQ 10 ENQ 20 SIZE DEQ DEQ DEQ
Output:
2 10 20 EMPTY

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Next