Deloitte Interview Question

Matrix traversal question, had seen a variation on Leetcode