#include <stdio.h>
int main() {
    int BOARD_SIZE = 3;
    int *board[BOARD_SIZE];
    board[0] = {1, 2, 3};
    board[1] = {3, 1, 2};
    board[2] = {2, 3, 1};
    int *validity[BOARD_SIZE];
    for (int i = 0; i < BOARD_SIZE; i++) {
        int row_array[BOARD_SIZE];
        validity[i] = row_array;
    }
    
    for (int row = 0; row < BOARD_SIZE; row++) {
        for (int col = 0; col < BOARD_SIZE; col++) {
            int element = board[row][col];
            // check element unique in row
            int unique = 0;
            for (int j = 0; j < BOARD_SIZE; j++) {
                if (j != col && element == board[row][j]) {
                    unique = 1;
                }
            }
            if (unique!= 0) {
                validity[row][col] = 0;
            }
    
            // check element unique in column
            for (int j = 0; j < BOARD_SIZE; j++) {
                if (j != row && element == board[j][col]) {
                    unique = 1;
                }
            }
            if (unique != 0) {
                validity[row][col] = 0;
            } else {
                validity[row][col] = 1;
            }
        }  
    }
}

validity[row][col] should be 1 if board[row][col] is unique among the row and column, otherwise 0.