Problem Details
Design a stack that supports getMin() in O(1) time and O(1) extra space



1. push(data) :
This function should take one argument of type integer. It pushes the element into the stack and returns nothing.
2. pop() :
It pops the element from the top of the stack and returns nothing.
3. top() :
It returns the element being kept at the top of the stack.
4. getMin() :
It returns the smallest element present in the stack.
Query-1(Denoted by an integer 1): Pushes integer data to the stack. (push function)
Query-2(Denoted by an integer 2): Pops the data kept at the top of the stack. (pop function)
Query-3(Denoted by an integer 3): Fetches and returns the data being kept at the top of the stack. (top function)
Query-4(Denoted by an integer 4): Returns the smallest element present in the stack. (getMin() function)
The first line contains an integer 'Q’, which denotes the number of queries to be run against each operation in the stack.
The next 'Q' lines represent an operation that needs to be performed.
For the push operation, the input line will contain two integers separated by a single space, representing the type of the operation in the integer and the integer data being pushed into the stack.
For the rest of the operations on the stack, the input line will contain only one integer value, representing the query being performed on the stack.
For Query-1, you do not need to return anything.
For Query-2, you do not need to return anything.
For Query-3, print the data kept on the top of the stack.
For Query-4, print the smallest element present in the stack.
Output for every query will be printed in a separate line.
You are not required to print anything explicitly. It has already been taken care of. Just implement the function.