Pergunta de entrevista da empresa Expeditors

Given an n x n matrix, write a function that sums the diagonals.