Easy10 min
Process a Queue
Process add:text and remove operations in order. Return the remaining queue. Removing from an empty queue does nothing.
Your function
Implement solve(value, extra) in JavaScript. Return the answer; printing alone does not count as a result.
Examples
Input:
[["add:a","add:b","remove"]]Output:
["b"]Input:
[["add:x"]]Output:
["x"]Constraints
Input contains at most 1,000 values or characters. Numbers are finite integers. Inputs follow the structure shown in the examples.