One test case not passed

kindly tell why 1 test case is not passed?? link to the code :https://ide.codingblocks.com/s/122896


I have edited your code, try to submit now.

why have u removed the if condition

some of the cases where if rows are greater and colloumns are less or vice versa the code will print something twice

same thing has been taught by PRATEEK bhaiya in webinar to avoid the repetition we use if condition

In this program, for avoiding repetition, you can simply use a direction variable, initializing it to 1 and then you can update its value in case of every loop, that will be the first method you can use to prevent the repetition problem, in case if rows and columns are not same, else the code which I have sent to you by removing the if condition will work fine.