Otherwise
else { int max = Math . Max ( a [ x ] + maxPreSum ( a , b , x + 1 , y ) , b [ y ] + maxPreSum ( a , b , x , y + 1 ) ) ; curr = Math . Max ( curr , max ) ; } dp [ new Tuple < int , int > ( x , y ) ] = curr ; return dp [ new Tuple < int , int > ( x , y ) ] ; }