AJIO interview question

Fill rows and columns with 0 problem