Sort the array

5

1 votes
Sorting, Very-Easy
Problem

Given an array of N integers, you need to print the array after each pass of radix sort. In each pass, you need to sort the array by digits starting from least significant digit to most significant digit.

Input:
The first line consists of an integer N denoting the size of array.
The next line consists of N space separated integers.

Output:
Print the array after each pass. See the output for clarity.

Constraints:
1N1000
0A[i]109

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Each line of the output is the array after each pass.

Editor Image

?