← All problemsSign in

Fear of Rectangles

Chef is very fond of squares but he didn't like rectangles at all instead he fears from them. To make him comfortable with the rectangles his teacher gave him a simple task. His teacher gave him a 2D matrix of N X M size , where n is number of rows and m is number of columns. He has to print the elements of the matrix in Diagonal wise. For the matrix shown in image traversal is: 3 7 9 98 88 7

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start