Efficiently sorting numbers in range from 0 to n^2 - 1
Easy Accuracy: 48.85% Submissions: 2375 Points: 2
Given an array of numbers of size n. It is also given that the array elements are in range from 0 to n2 – 1. Sort the given array in linear time.
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains an integer n denoting the size of the array. The following line contains n space separated integers.