

The first line contains ‘T’, denoting the number of tests.
For each Test :
The first line contains an integer ‘N’, denoting the length of the array.
The second line contains an array ‘A’ of length ‘N’.
For each test, print an integer, denoting the maximum number of subarrays in which he can break the array and still get the final array sorted.
You are not required to print the expected output. It has already been taken care of. Just implement the function.
1 <= ‘T’ <= 5
1 <= ‘N’ <= 10^5
0 <= A[i] < N i ∈ (1,N)
All elements A[i] are unique.
Time Limit: 1 sec
Algorithm:
We know that the final array should look like [0, 1, 2 …… N-1], by which it’s observed that the maximum element in the prefix of length ‘x’ is value ‘x’ itself. Though all elements are unique, it can be concluded that if the maximum of any prefix is ‘p’ then [0, 1…. p-1] are also covered and the array can be divided at this position.
Algorithm: