Problem title
Difficulty
Avg time to solve

Ninja And Editor
Easy
20 mins
Encoded Letter
Moderate
25 mins
Tree Jumping
Hard
50 mins
Base Conversion
Easy
15 mins
Number of ones in the smallest repunit
Moderate
30 mins
Conversion
Easy
20 mins
Remove Comments
Moderate
15 mins
Last Substring In Lexicographical Order
Hard
45 mins
Minimum And Maximum
Easy
15 mins
Rectangles In N x N Board
Moderate
20 mins

Radix Sort

Difficulty: MEDIUM
Contributed By
Avg. time to solve
20 min
Success Rate
78%

Problem Statement

Ninja is given an array of integers ‘ARR’ of size ‘N’. He has to sort the given array in increasing order using radix sort.

Ninja called you for help as you are his only friend. Help him to solve the problem.

Example :
Input: ‘N’ = ‘4’ ,  'V' = [ 2 , 1 , 4 , 3 ] 

Output: "1 2 3 4"

As [ 1 , 2 , 3 , 4 ] is the sorted order.
Input Format :
The first line will contain the integer 'T', denoting the number of test cases.

For each test case, the first line contains a single integer ‘N’ the size of the input array.

Second-line contains ‘N’ space-separated integers which are the elements of the input array.
Output format :
For each test case, print the element of the array input array in increasing order.
Note :
You don't need to print anything. It has already been taken care of. Just implement the given function.
Constraints :
1 <= 'T' <= 10
1 <= ‘N’ <= 10^4
1 <= ARR[i] <= 10^9
Time Limit: 1 sec
Sample Input 1 :
2
4
1 4 3 5
5 
5 4 3 2 1
Sample Output 1 :
1 3 4 5
1 2 3 4 5
Explanation Of Sample Input 1 :
In test case ‘1’, ‘1 3 4 5’ is the increasing sorted order.
In test case ‘2’. ‘1 2 3 4 5’ is the increasing sorted order.
Sample Input 2 :
2
2
30 25
6 
2 2 2 2 2 2
Sample Output 2 :
25 30
2 2 2 2 2 2
Reset Code
Full screen
copy-code
Console