
If 'ARR' is [2,1,4,3] ,the formed tree will be:

The maximum depth of the tree is 3. Hence the answer is 3.
The first line of the input contains an integer, 'T,’ denoting the number of test cases.
The first line of each test case contains a single integer, 'N,’ denoting the number of elements in ‘ARR’.
The next line of each test case has ‘N’ integers corresponding to the elements of 'ARR’.
For each test case, return a single integer corresponding to the maximum depth of the BST.
You do not need to print anything. It has already been taken care of. Just implement the given function.
1 <= T <= 10
1 <= N <= 10^5
1 <= 'ARR'[i] <= N
Time limit: 1 sec
In this approach, we will prepare an array 'DEPTH' to store the depth of all values in the BST.
We will store the values in sorted order in an ordered Set as insertion, deletion, and searching takes O(logN) time. We will iterate through all values and search for the value 'VAL' in the set whose value is just greater than the current value and set the depth of the current value as the depth of 'VAL' + 1, and we will also store the maximum depth in a variable.