Find the longest path in a matrix with given constraints - GeeksforGeeks
Find the longest path in a matrix with given constraints
Given a n*n matrix where numbers all numbers are distinct and are distributed from range 1 to n2, find the maximum length path (starting from any cell) such that all cells along the path are increasing order with a difference of 1.
We can move in 4 directions from a given cell (i, j), i.e., we can move to (i+1, j) or (i, j+1) or (i-1, j) or (i, j-1) with the condition that the adjacen
Read full article from Find the longest path in a matrix with given constraints - GeeksforGeeks
No comments:
Post a Comment