in a lower triangular matrix, i th row contains (i +1) number of non zero elements.

Let's count how many elements are there before arr[i,j]----> If we assume array index starts from 0 then,

before i th row there are i rows(row 0 to i-1) , and in total these rows has 1+2+3.....+i =i(i+1)/2 elements(row 0 has 1 element, row 1 has 2 elements, .... row i-1 has i elements)

Now at i row, before j th element there are j elements(starting from arr[i,0] to arr[i,j-1]),

Hence in total before arr[i,j] there are (i(i+1)/2 + j) elements and those elements will have indexes

0 to (i(i+1)/2 + j -1) in the new compact array, hence the very next element arr[i,j] (of the old lower triangular matrix) will have index i(i+1)/2 + j in this new single dimensional compact array.

But none of the option is i(i+1)/2 + j, Actually, they have considered array indexes starting from 1 .

If we assume Array index starting from 1 then,

i th row contains i number of non zero elements.

before i th row there are i -1 rows(row 1 to i-1) , and in total these rows has 1+2+3.....+(i-1)= i((i-1)/2 elements(row 1 has 1 element, row 2 has 2 elements, .... row i-1 has i-1 elements)

Now at i th row, before j th element there are (j-1) elements(starting from arr[i,1] to arr[i,j-1]),

Hence in total before arr[i,j] there are (i(i-1)/2 + j-1) elements and those elements will have indexes

1 to (i(i-1)/2 + j-1) in the new compact array, hence the very next element arr[i,j] (of the old lower triangular matrix) will have index i(i-1)/2 + j in this new single dimensional compact array. Answer C.