# To calculate the maximum sum of subarray ending at current element, say maxEnding, # we can use the maximum sum ending at the previous element. # So for any element, we have two choices: # Choice 1: ...