← 返回 meta 的题目列表Longest Increasing Path in a Matrix
类型:online_judge
meta
Given a 2D integer matrix matrix, find and return the length of the longest increasing path in the matrix. You can start and end at any position, moving only up, down, left, or right, with requirement that the numbers must increase in the path.
Input/Output Requirements
Input: matrix, a 2D integer array with size within [0, 200] x [0, 200].
Output: An integer representing the length of the longest increasing path.
Example Input
[
[9, 9, 4],
[6, 6, 8],
[2, 1, 1]
]
Example Output
4
Example
Input
[[9,9,4],[6,6,8],[2,1,1]]