← 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]]?
- A.1 2 3 4 5 6 7 8 9
- B.1 2 3 6 9 8 7 4 5
- C.1 4 7 8 9 6 3 2 5
- 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 →