Arrays-Wave print Column Wise

https://hack.codingblocks.com/contests/c/474/218
https://ide.codingblocks.com/#/s/24383

https://ide.codingblocks.com/#/s/24436
Corrected code…

For my code, the sample input is passing. But while submitting, all the test cases are failing. Please help.
https://ide.codingblocks.com/s/34225

@iamabhi3913
Your code works only for square matrices but not for rectangular matrices, ie when n!=m

@iamabhi3913
for example for the test case
3 4
11 12 13 14
21 22 23 24
31 32 33 34

your code gives output
11, 21, 31, 32, 22, 12, 13, 23, 33, END
which is wrong

@iamabhi3913

https://ide.codingblocks.com/s/34311

i have made the required changes as mentioned by @sss

Check this now.

Thank you. Please let me know how to start thinking for different possible set of inputs so as to ascertain the behavior with test cases.

This understanding would come only by practice. There is no other way…