Shopify Interview Question

Some average two-dimensional array problem