public static int[] getMinimumSymmetricOfEveryRow (int [][] A)
{
int min = Integer.MAX_VALUE;
int[] arr=new int[A.length];
for (int i = 0; i < A.length; i++){
for (int j = 0; j < A[i].length; j++){
if (A[i][j] < min && isSymmetric(A[i][j])){
arr[i] = A[i][j];
}
}
}
return arr;
}
This is my function which return array of min symmetric element from each row in 2D array. It works fine for array[n][n] and but not for array[m][n]... ( it return m elements instead of n). I don't know what is the problem ??