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 ] = max ( x , max ( y , max ( z , max ( w , 1 ) ) ) ) NEW_LINE return dp [ i ] [ j ] NEW_LINE