Given a 2D matrix of integers, find the length of the longest path where each step moves to an adjacent cell (up, down, left, right — no diagonals) and each value is strictly greater than the previous.
example:
Input:
A = [9 9 4;
6 6 8;
2 1 1]
Output: 4

Solution Stats

7 Solutions

5 Solvers

Last Solution submitted on May 06, 2026

Last 200 Solutions

Solution Comments

Show comments
Loading...

Problem Recent Solvers5

Suggested Problems

More from this Author9

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!