Input: N = 4, arr[][] = {{1, 2, 3, 4}, {2, 1, 4, 3}, {3, 4, 1, 2}, {4, 3, 2, 1}}
Output: 0 0
Explanation: None of the rows or columns contain repeated values.
Input: N = 4, arr[][]= {{2, 2, 2, 2}, {2, 3, 2, 3}, {2, 2, 2, 3}, {2, 2, 2, 2}}
Output: 4 4
Explanation: In every column and every row of the square matrix, the values are repeated. Therefore, the total count is 4 for both rows and columns.