public static int[] sumRow(int[][] N){
int[] rowSum = new int[N.length];
for(int i = 0; i
You have written most of the code right but you need to add each row so, you need to add N[0][1], ....N[0][N[0].length - 1] in row 0. Now just plug i and j values and write on paper to be much clear.