Microsoft Interview Question

Leetcode medium question related to matrices