PIMCO interview question

Matrix array summation problem on HackerRank