How to check in 2d array if all elements in row and column are the same?
问题 I am trying to write a code in java that would look if all elements in a row and column are the same and print out the indexes of it. So for example if I had two dimensional array of { 1, 0, 0, 0, 0} { 1, 0, 0, 0, 0} { 1, 1, 1, 1, 1} I want to print out 2,0 which means that in the row 2 all the elements are the same and in column 0 all the elements are the same too and they are equal to each other. I was trying to do it with for statements int[][] array_1 = { {1}, {1} }; for(int row=0; row