The next states are don 't take  this element and go to (i + 1)th state  else take this element  and go to (i + 2)th state
dp [ i ] = max ( maxSum ( i + 1 , subarr ) , subarr [ i ] + maxSum ( i + 2 , subarr ) ) NEW_LINE return dp [ i ] NEW_LINE