So, I have two multi-dimension arrays.
    double[][] combinations = new double[10000][3];
    double[][] uniqueCombinations = new double[100][3];
Array values example:
[[1.233, 1.333, 0.76], [1.1, 1.333, 1.333], [0.9, 1.1, 0.9], [1.1, 1.333, 1.333]]
Here is what I want
[[1.233, 1.333, 0.76], [1.1, 1.333, 1.333], [0.9, 1.1, 0.9]]
I want to get all the unique arrays from combinations and populate uniqueCombinations with that.
I tried with this function, but it populates with only 5 arrays, weird!
public static double[][] removeDuplicate(double[][] matrix) {
    double[][] newMatrix = new double[matrix.length][matrix[0].length];
    int newMatrixRow = 1;
    for (int i = 0; i < matrix[0].length; i++)
        newMatrix[0][i] = matrix[0][i];
    for (int j = 1; j < matrix.length; j++) {
        List<Boolean> list = new ArrayList<>();
        for (int i = 0; newMatrix[i][0] != 0; i++) {
            boolean same = true;
            for (int col = 2; col < matrix[j].length; col++) {
                if (newMatrix[i][col] != matrix[j][col]) {
                    same = false;
                    break;
                }
            }
            list.add(same);
        }
        if (!list.contains(true)) {
            for (int i = 0; i < matrix[j].length; i++) {
                newMatrix[newMatrixRow][i] = matrix[j][i];
            }
            newMatrixRow++;
        }
    }
    int i;
    for(i = 0; newMatrix[i][0] != 0; i++);
    double finalMatrix[][] = new double[i][newMatrix[0].length];
    for (i = 0; i < finalMatrix.length; i++) {
        for (int j = 0; j < finalMatrix[i].length; j++)
            finalMatrix[i][j] = newMatrix[i][j];
    }
    return finalMatrix;
}
 
    