#C1692. Row or Column Constant Checker
Row or Column Constant Checker
Row or Column Constant Checker
You are given an matrix of integers. Your task is to determine whether there exists at least one row or one column in which every element is identical. In other words, check if there is any row or column for which all elements are equal.
For example, consider the matrix:
$$\begin{bmatrix} 1 & 2 & 3 \\ 4 & 4 & 4 \\ 5 & 6 & 7 \end{bmatrix} $$In this case, the second row consists entirely of 4s, so the answer is True
.
The input is provided via standard input and the output should be printed to standard output.
inputFormat
The first line of input contains two integers and , representing the number of rows and columns respectively. Each of the following lines contains space-separated integers, representing the elements of the matrix.
outputFormat
Print True
if there is at least one row or column where all elements are the same; otherwise, print False
.## sample
3 3
1 2 3
4 4 4
5 6 7
True