Arrays & Linked Lists

Your answer
Answer & solution
Answer: C: i(i−1)/2+j (no official key was published)
Before row i, the stored rows have lengths 1,2,…,i−1, totaling i(i−1)/2 entries. Entry j in the next row is j positions beyond that prefix under one-based indexing. Therefore its packed index is i(i−1)/2+j. A zero-based packed offset would subtract one from this result. The formula stores every position in the lower triangle, even if a particular value happens to be zero; omitting actual zeros would require additional sparse-matrix metadata.