Array Wave Print Column Wise -Java

What is problem in my code It is not accepting test cases.But on compilation gives same desired output.
Please Help.

@D19WDPP0006,
https://ide.codingblocks.com/s/426348 corrected code

Your code was incorrect for:
Input:
2 3
1 2 3
4 5 6
Correct answer:
1, 4, 5, 2, 3, 6, END

1 Like