Microsoft Interview Question

Create a function to solve the following matrix.