Implement Counting Sort

Easy

Given an array, sort it using counting sort.

Testing

Input Format

The first line contains 'T' denoting the no. of test cases.

Next T lines each contain a number 'n' denoting the number of elements, followed by n space-separated numbers denoting the array elements.

Output Format

T lines contain n numbers denoting the sorted array.

Sample Input

2
5 4 2 5 3 1
3 11 4 200

Expected Output

1 2 3 4 5
4 11 200

Constraints

0 <= T <= 1000

1 <= N <= 1000

-1000 <= array element <= 1000

Companies
Editorial Link: Editorial