X Interview Question

Was basically a 2d matrix question, more or less leetcode medium