Let's say the pet shop's oldest dog’s uID that has not yet been adopted is 4 and that of the oldest cat is 3.
If operation 2 0 is performed then the oldest dog will be adopted i.e uID 4.
If operation 2 1 is performed then the oldest cat will be adopted i.e uID 3.
If operation 2 2 is performed then the animal older among them will be adopted.
The first line contains a single integer ‘T' representing the number of test cases.
The first line of each test case contains a single integer ‘N’ representing the number of operations.
Next ‘N' lines contain operations that have to be performed on the shop. Each operation is either of type 1 or 2.
For each test case print a vector/list that contains the unique identification number of pets that are adopted in the order they are adopted.
1. All the operations are valid.
2. You do not need to print anything; it has already been taken care of. Just implement the function.
1 <= T <= 10
1 <= N <= 1000
1 <= uID <= 10^6
0 <= type1 <= 1
0 <= type2 <= 2
Time Limit: 1sec
Postorder Traversal
Min Stack
Stock Span
Hills and Soldier
Hills and Soldier
Next Greater Element II