Pergunta de entrevista da empresa FactSet

Given a matrix calculate the path that yields the maximum value.