🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Matrix Traversal: all 13 questions

Quiz: Matrix Traversal · Question 2 of 13

What is the spiral order of [[1, 2, 3], [4, 5, 6], [7, 8, 9]]?

What is the spiral order of [[1, 2, 3], [4, 5, 6], [7, 8, 9]]?

  1. A.1 2 3 4 5 6 7 8 9
  2. B.1 2 3 6 9 8 7 4 5
  3. C.1 4 7 8 9 6 3 2 5
  4. D.1 2 3 6 5 4 7 8 9
Answer & explanation

Correct answer: 1 2 3 6 9 8 7 4 5

Right along the top, down the right side, left along the bottom, up the left side, then the centre.

Can you get the rest right without peeking?

Take the timed Quiz: Matrix Traversal quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →