Move zero elements up
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Given a two-dimensional array of size n x m, your task is to shift all zero elements downwards within each column.
Input
The first line of the input consists of two integers, n and m, representing the number of rows and columns, respectively.
The following n lines each contain m integers, which are the elements of the array.
Output
Print the modified array.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 58%