Attenti interview question

Recursive question with matrix, writing code is not required