


The first line contains 'T', denoting the number of test cases.
For each Test :
The first line contains an integer, 'N'.
The second line contains an array 'A' of 'N' space-separated integers, with a positive integer representing a node and -1 representing a NULL value.
The input array 'A' denotes Level Order traversal of the BST.
(Note that 'N' is not the number of nodes in the BST, only positive integers in 'A' denote nodes of BST).
For each test case, print one integer, denoting the price of a given BST, i.e., minimum node value in it.
You are not required to print the expected output. It has already been taken care of. Just implement the function.
1 <= 'T' <= 10
1 <= 'N' <= 10^5
1 <= A[i] <= 10^6 or A[i] = -1, i ∈ (1, N)
Note - The sum of 'N' over all test cases does not exceed 2 * 10^5.
Time Limit: 1 sec
Algorithm:
Start from the root and move in only the left direction. The leftmost leaf node in the tree is our answer.
If the tree is left-skewed, this optimized approach works exactly the same as the normal traversal, shown in Approach-1.
Algorithm: