Posts

Showing posts from April 9, 2021

Matrix - Find Missing Element

Matrix - Find Missing Element  PROBLEM STATEMENT :      The program must accept an integer matrix of size R*C and an integer S as the input. Exactly one element in the given matrix is missing, which is denoted by the character M. The integer S represents the sum of all the integers in the column of the missing element. The program must find the value of M and replace it in the given matrix. Finally, the program must print the integer matrix with all the R*C integers as the output.  Boundary Condition(s):  2 <= R, C <= 50  1 <= Matrix element value <= 1000  1 <= S <= 10^5  Input Format:   The first line contains R and C separated by a space.  The next R lines contain the matrix. The (R+2)nd line contains S.  Output Format:   The first R lines, each contains C integer values separated by a space.  Example Input/Output 1: Input: ( ) 3 3 2 5 8 1 5 M 9 7 6 17 Output: 2 5 8 1 5 3 9 7 6 Explan...