Walmart Global Tech interview question

coding question was on graph and 2d matrix