Check each collumn and row for duplicate C++ : I have to check if latin square is true by user input. But i can't figure out how to do the check part. Where it checks each collumn and row for duplicate numbers.

This is what i came up with, but it doesn't seem to work properly

    // arr= input by user in array, and n= array length by user input     
    bool latin(int**arr,int n)
        {
          int times=0;
          int s;
    
            for(int j=0;j<n;j++)
                {
                for(int i=0; i<n;i++){
    
                    if (arr[i][j]==s) times++;
    
                }
            }
    
        if (times != 1) return false;
        else return true;
        }