Design a bounded queue with a fixed capacity. A real bounded blocking queue blocks producers when full and consumers when empty using concurrency primitives. Here you implement a single-threaded simulation of the data structure - there is no real blocking or threading. Instead of blocking, a full enqueue or an empty dequeue simply reports failure.
enqueue(value)adds an element to the back; returnstrueif it was added, orfalseif the queue is already at capacity.dequeue()removes and returns the element at the front, or-1if the queue is empty.size()returns the current number of elements.
Implement the function boundedQueue(capacity, operations) where capacity is the maximum size and operations is a list of [op, ...args]: ["enqueue", v], ["dequeue"], ["size"]. Return the list of results, one per operation (use null for operations that return nothing - here every operation returns a value).