Longest Increasing Path in a Matrix Problem

Longest Increasing Path in a Matrix Problem — ExecCode Hard DSA Practice

Solve the Longest Increasing Path in a Matrix problem on ExecCode. Free online hard DSA practice in Arrays - Basics. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Given an m×n integers matrix, return the length of the longest increasing path. From each cell you may move 4-directionally to a strictly greater cell.

Examples

Input matrix = [[9, 9, 4], [6, 6, 8], [2, 1, 1]]; Output 4

Constraints

1 ≤ m,n ≤ 200 0 ≤ matrix[i][j] ≤ 2^31 - 1

Practice Longest Increasing Path in a Matrix free on ExecCode. Browse DSA problems, topic map, and placement guides.