If the parity of the current and previously selected element are different , then select the current element
if ( cur != prev ) : NEW_LINE INDENT dp [ i ] [ prev ] = arr [ i ] + maxSum ( arr , i + 1 , n , cur , 1 , dp ) NEW_LINE DEDENT