Here is the question:-
Q1. Minimum In A Stack
In what minimum time complexity you can compute minimum at any state of stack?
O(1)
O(n)
O(n^2)
How is the time complexity is O(1), because if the size of stack at the current is n, then we need to run a while to check which is the minimum element in the stack.