Coding

Find the longest increasing path in a matrix.

Given an m x n integers matrix, return the length of the longest strictly increasing path in the matrix. From each cell, you can either move in four directions: left, right, up, or down.

Input: matrix = [[1,2],[3,4]]

Output: 3

Explanation: The longest strictly increasing path is 1 -> 3 -> 4 (or 1 -> 2 -> 4), both of which have a length of 3.

Was asked at

Practice this question with AI

First session is free - no credit card required.

Go Premium

More interviews, more skills, more success.

No answers yet

Be the first to share your approach to this question

Practice More Questions