Question:
Given an 2D array of size N x M. Find the longest Increasing path in 2D array by doing following constraints:
You can start from any cell.
From (x, y) you can go to any (x, u) or (v, y) i.e. from any cell c1 you can go to any other cell c2 such that they share a common column or row and value at c1 < value at c2.
All elements in array are unique.