Amazon interview question

Matrix-related coding programming challenge through Hackerrank