Data Structures & AlgorithmsHardICPC regional · GATE CS

Problem: The matrix [[1,2],[3,4]] is raised to the power 3 (matrix multiplication, not element-wise). What is the entry in row 0, column 0 of the result?

  1. A. 7
  2. B. 1
  3. C. 37
  4. D. 199

Correct answer: C. 37

M² = [[7,10],[15,22]] and M³ = [[37,54],[81,118]], so the top-left is 37. M² gives 7, cubing element-wise gives 1, and M⁴ gives 199.

More Coding Interview Problems questions

Exams that ask this topic