Here x is value of F ( i + 2 , j ) , y is F ( i + 1 , j - 1 ) and z is F ( i , j - 2 ) in above recursive formula
x = ( ( i + 2 ) <= j ) ? table [ i + 2 , j ] : 0 ; y = ( ( i + 1 ) <= ( j - 1 ) ) ? table [ i + 1 , j - 1 ] : 0 ; z = ( i <= ( j - 2 ) ) ? table [ i , j - 2 ] : 0 ; table [ i , j ] = Math . Max ( arr [ i ] + Math . Min ( x , y ) , arr [ j ] + Math . Min ( y , z ) ) ; } } return table [ 0 , n - 1 ] ; }