What does Diagonal order mean?

What does Diagonal order mean? The description is not provided. So what I understood is we have to follow that pattern given int he example. What will be the output for the case: M=1 and N=4 ; input= 1 2 3 4 ? (according to this diagonal print pattern)

hi @anujeet.s, output should be 1 2 3 4

you can refer https://www.geeksforgeeks.org/print-matrix-diagonal-pattern/ for pictorial representation
if having implementation difficulties refer https://ide.codingblocks.com/s/659354, make sure you do a dry run of the matrices I’ve commented at bottom

hope this helps

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.