I have an array of type int
matrix[][]
and it has values of 0 and 1
000000000
101010111
000010100
110011001
the values are different to the above, however this is a random example.
What i need to do is,
loop through the first row when column = 0 and row = 0 adding 1 to row to loop
if a one is found add it to a variable
when i get to the end of the row i need to then go down the colum 0 row = 0 adding 1 to column to get the loop
then i need to check the sum variable i have been adding to is % 2 = 0
then i need to check row 1 column 1
and repeat for all
the problerm i am having is determining when i have got to the end of a row, how is this calculated?
for(int row = 0; row < matrix.length; row++){
if(matrix[columns][row] == 1){
sum ++;
if(i am at the end of the row){
//continue with other steps here