NB: Question is ambiguous ,Nothing specified in question whether matrix index starts from (0,0) or (1,1).
Quick way to solve such questions in exams will be checking options with an example.!
$\begin{bmatrix} 1 &0 &0 \\ 2 & 3 & 0\\ 4 & 5& 6 \end{bmatrix}$
can be compactly written in an array as
$\begin{bmatrix} 1 &2 &3 &4 &5 & 6 \end{bmatrix}$
Trial 1:
- let us assume index starts as (0,0)
- For element 5, index will be (i,j)= (2,1) and stored in array index 4
- No option gives 4 as answer
Trial 2:
- Assume matrix index starts as (1,1)
- Again check element 5, index will be (i,j)= (3,2) and stored in array index 5. Only options A and B give result as 5. Eliminate C and D
- Now check element 1, index will be (i,j)= (1,1) and stored in array index 1. only option B will give result as 1.
Answer is B