Wave print / 2d array video

i did not understand the code in the video,
kindly explain me with the help of comments and the code, kindly cooments that particular if else loop,i want to know about that for loops for odd and even rows,

kindly explain in detail, i am totally blanked ,

i dont know how he write m-1 in second for loop, whats going on in this code, please send me the proper code and with proper comments AS SOON AS POSSIBLE

hello @shashank_sabharwal
here is the code with the proper explanation .


i hope you have undderstood everything in the code .
please hit the like button and mark this as the resolved .
Happy Learning !!

@shashank_sabharwal i have updated code for column waive as well .
it was just a small change to be made to do so .
as you have run your loop for the number of rows times and you have to replace the position of i and j .
i hope i have cleared your doubt .
hit the like button if you feel your doubt is cleared .
Happy Learning !!