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.
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.