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 ] ; }