You are given an
A path is defined by consecutively moving from one cell to another adjacent cell. From any cell, movement is allowed only in four directions: up, down, left and right.
Diagonal movement is not allowed. You also cannot move outside the matrix boundaries (no wrap-around).
A path is considered increasing if each subsequent cell contains a strictly greater integer than the previous one.
Your goal is to return the maximum length among all possible increasing paths in the matrix.
Constraints:
matrix.length
matrix[i].length
matrix[i][j]
You are given an
A path is defined by consecutively moving from one cell to another adjacent cell. From any cell, movement is allowed only in four directions: up, down, left and right.
Diagonal movement is not allowed. You also cannot move outside the matrix boundaries (no wrap-around).
A path is considered increasing if each subsequent cell contains a strictly greater integer than the previous one.
Your goal is to return the maximum length among all possible increasing paths in the matrix.
Constraints:
matrix.length
matrix[i].length
matrix[i][j]