10285 - Longest Run on a Snowboard


Difficulty : medium

Solution Description :

Graph DFS longest depth find problem (DAG)

For each point (x,y) you can find 4 adjacency (x,y-1), (x,y+1), (x-1,y), and (x+1,y) if and only if the adjacency point height is less then the height of point (x,y).
Run DFS for each point (i,j) and find the maximum depth.