If none of the adjacent fours is one greater we will take 1 otherwise we will pick maximum from all the four directions
dp [ i ] [ j ] = Math . Max ( x , Math . Max ( y , Math . Max ( z , Math . Max ( w , 1 ) ) ) ) ; return dp [ i ] [ j ] ; }