The first line of input contains an integer 'T' representing the number of test cases.
The first line of each test case contains one integer ‘N’ denoting the number of elements in the array.
The second line of each test case contains N space-separated integers denoting the elements of the array “heights”.
For each test case, print the number of blocks that are present in the wrong locations.
Print the output of each test case on a new line.
You don’t need to print anything; It has already been taken care of.
1 <= T <= 5
1 <= N <= 10^5
1 <= heights[i] <= 10^9
Where 'heights[i]' represents the height of the ith block.
Time Limit: 1 sec
The idea here is to create a copy of the array 'HEIGHTS', say 'HEIGHT_COPY', and then sort the 'HEIGHT_COPY' array. Now check if the element present at 'HEIGHTS'[i] is not equal to the 'HEIGHT_COPY'[i], then increment the 'ANS' count by 1.
The algorithm is as follows: