Difficulty Level : Easy
Submissions : 30
Asked In :
Marks :10
: 1 | : 0
Given a 2D Matrix of integers, print all its element if you start traverse diagonally starting from $(0,0)^{th}$ element.
$1 \leq N, M \leq 10^{4}$
$1 \leq N x M \leq 10^{4}$
$1 \leq Matrix Element \leq 10^{4}$
The first line contains two integers $N$ $M$ - number of rows and columns of matrix respectively.
The next $N$ lines contain $M$ integers each representing the Matrix.
Print a single line listing all matrix elements that we visit in order as described in problem.
3 3
1 2 3
4 5 6
7 8 9
Sample 1 OUTPUT: 1 2 4 7 5 3 6 8 9
ExplanationYou need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.