Given an m $ imes$ n integer matrix mat, you can choose any cell in the matrix as your starting point.
From a cell (r, c), you can move to any other cell located in the same row or column, provided that the value in the destination cell is strictly greater than mat[r][c].
Return the maximum number of cells that can be visited along a valid path.
Constraints:
m == mat.length
n == mat[i].length
m, n
m $ imes$ n
mat[i][j]
Given an m $ imes$ n integer matrix mat, you can choose any cell in the matrix as your starting point.
From a cell (r, c), you can move to any other cell located in the same row or column, provided that the value in the destination cell is strictly greater than mat[r][c].
Return the maximum number of cells that can be visited along a valid path.
Constraints:
m == mat.length
n == mat[i].length
m, n
m $ imes$ n
mat[i][j]