PIMCO Interview Question

Matrix array summation problem on HackerRank