How would you implement a stack using a queue data structure?
Implement implement_stack(operations) using one queue. Each operation is an array: ["push", value], ["pop"], ["top"], or ["empty"]. Return the results of pop, top, and empty operations in order. pop and top are only called when the stack is non-empty.
Example: [["push", 1], ["push", 2], ["top"], ["pop"], ["empty"]] returns [2, 2, false].
Constraints: at most 10^4 operations, and pushed values are integers.
pop and top are called only when the stack is non-emptydef implement_stack(operations):