Amazon interview question

Leetcode medium problem focused on matrix