Example 1

Example 2

m == mat.lengthn = mat[i].lengtharr.length == m * n1 <= m, n <= 1051 <= m * n <= 1051 <= arr[i], mat[r][c] <= m * nAll the integers of arr are unique.All the integers of mat are unique.Example 1

Example 2

m == mat.lengthn = mat[i].lengtharr.length == m * n1 <= m, n <= 1051 <= m * n <= 1051 <= arr[i], mat[r][c] <= m * nAll the integers of arr are unique.All the integers of mat are unique.