Back to problems

Copy an Image Matrix

Algorithm · Luma AI · Easy

Problem: Deep-Copy an Image Matrix Third-party libraries are not allowed. A grayscale picture is stored as an integer matrix with H rows and W columns. The value of the pixel located at row i and column j is image[i][j]. Implement a function that creates and returns an independent copy of this matrix. For evaluation, your program must receive the image through standard input and write the duplicated matrix to standard output. Input Format Every row provides exactly W…

Loading the rest of the question…