阅读量:0
Question:
Ann x n
matrix isvalidif every row and every column containsallthe integers from1
ton
(inclusive).
Given ann x n
integer matrixmatrix
, returntrue
if the matrix isvalid.Otherwise, returnfalse
.
Example 1:
Input: matrix = [[1,2,3],[3,1,2],[2,3,1]] Output: true Explanation: In this case, n = 3, and every row and column contains the numbers 1, 2, and 3. Hence, we return true.
Example 2: