I'm trying to figure out whats the most simple way to add to fill this 2D Array with only non duplicate numbers.
I've tried to use a method with boolean to check the value before adding it, if it already exists but I couldn't make it work.
int[][] x = new int[R][C];
for (int i = 0; i < x.length; i++) {
for (int j = 0; j < x[i].length; j++) {
double z = (Math.random() * ((30 * (j + 1)) - ((30 * j) + 1)) + 1 + ((30 * j) + 1));
card[i][j] = (int) z;
}
}