Condition to not select the current element if possible
if ( i - 1 >= j ) : NEW_LINE INDENT val = max ( val , dp [ i - 1 ] [ j ] ) NEW_LINE DEDENT dp [ i ] [ j ] = val NEW_LINE return dp [ n ] [ n // 2 ] NEW_LINE