Given an array of distinct positive numbers, the task is to calculate the minimum number of subsets (or subsequences) from the array such that each subset contains consecutive numbers.
Expected Time Complexity: O(N. log(N)) Expected Auxiliary Space: O(1)
The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Each test case contains an integer N, denoting the length of the array. Next line contains N space seperated integers of the array.
For each test case output a new line denoting count of number of such subset's that contains consecutive numbers.
You don't have to print anything, printing is done by the driver code itself. Complete the function numofsubset() and return the answer.