public boolean checkSolve(int[][] matr) {
        for (int i = 0; i < Colors.size(); i++) {
            for (int j = 0; j < Colors.size(); j++) {
                if (j != i && matr[i][j] == 1) {
                    if (Colors.get(i) == Colors.get(j)) {
                        return false;
                    }
                }
            }
        }
        return true;
    }