Microsoft interview question

Create a function to solve the following matrix.