Doubt --Arrays-Wave Print Row Wise

ques–https://hack.codingblocks.com/app/contests/1975/410/problem
code–
https://ide.codingblocks.com/s/391230

Have debugged your code here, now it’s accepting all test case.

if(i%2!=0) be written as if(i%2) will work the same way , how does that matter

Change is not there bro, change is in the inner for loop where you are initialising it with n instead of m

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.