Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. Brian W. Kernighan
Write a function to find minimum and maximum value from the queue. You can use two stacks to store the values. Stack uses last in first out approach to push and pop elements.
Write a program to implement a queue with two stacks for finding minimum and maximum items using (1) time?
Items in the Stack: [12, 1, 12, 56, 78, 99] Minimum item from the stack:1 Maximum item from the stack:99