Longest Increasing Path in Matrix
Hard
Dynamic Programming
DFS
Memoization
Find longest increasing path in matrix.
Input: matrix rows
Output: length
Constraints
See problem-specific constraints. Optimized solution required.
Examples
Example 1:
Input: 9 9 4
6 6 8
2 1 1
Output:
Example 2:
Input: 9 9 4
6 6 8
2 1 1
Output:
Hints
Consider a dfs approach.
Think about time complexity.
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console